diff src/i2c.asm @ 429:4b93354b7738

hardware_flag handling
author heinrichsweikamp
date Thu, 16 Jun 2016 13:21:46 +0200
parents ceb1b7329dce
children aadfe9f2edaf
line wrap: on
line diff
--- a/src/i2c.asm	Wed Jun 15 12:26:48 2016 +0200
+++ b/src/i2c.asm	Thu Jun 16 13:21:46 2016 +0200
@@ -498,6 +498,7 @@
     rcall       I2C_TX
     movlw	b'01100100'	; CTRL5 HIGH res, 6,25Hz
     rcall       I2C_TX
+init_compass1_common:
     ;movlw	b'01100000'	; CTRL6 Full scale (+/-12 Gauss -> 2730LSB/Gauss)
     movlw	b'00000000'	; CTRL6 (+/-2 Gauss)
     rcall       I2C_TX
@@ -526,13 +527,7 @@
     rcall       I2C_TX
     movlw	b'01110100'	; CTRL5 HIGH res, 100Hz
     rcall       I2C_TX
-    movlw	b'01100000'	; CTRL6 Full scale (+/-12 Gauss -> 2730LSB/Gauss)
-    rcall       I2C_TX
-    movlw	b'00000000'	; CTRL7 Continuous Mode
-    rcall       I2C_TX
-    bsf		SSP1CON2,PEN		; Stop condition
-    rcall	WaitMSSP
-    return
+    bra		init_compass1_common
     
     global  I2C_sleep_compass
 I2C_sleep_compass: