diff src/i2c.asm @ 621:1ad0531e9078

3.01 release
author heinrichsweikamp
date Sat, 23 Feb 2019 16:51:14 +0100
parents cd986267a5ca
children c40025d8e750 be8787f2034d
line wrap: on
line diff
--- a/src/i2c.asm	Fri Feb 22 16:30:05 2019 +0100
+++ b/src/i2c.asm	Sat Feb 23 16:51:14 2019 +0100
@@ -84,8 +84,6 @@
 
 	global	I2C_RX_accelerometer
 I2C_RX_accelerometer:
-    	btfss	compass_enabled					; Compass enabled?
-	return							; No, return
 	btfsc	compass_type2					; compass2 ?
 	bra		I2C_RX_accelerometer_compass2	; YES
 	btfsc	compass_type					; compass1 ?
@@ -271,9 +269,6 @@
 
 	global	I2C_RX_compass
 I2C_RX_compass:
-    	btfss	compass_enabled					; Compass enabled?
-	return							; No, return
-
 	btfsc	compass_type2				; compass2
 	bra		I2C_RX_compass2				; yes
 	btfsc	compass_type				; compass1?
@@ -502,32 +497,7 @@
 
 	btfsc	compass_type				; compass1?
 	bra		I2C_init_compass1			; yes
-	
-	; Check for compass0
-	bsf		SSP1CON2,SEN				; Start condition
-	rcall	WaitMSSP
-	movlw	0x3C						; address
-	rcall	I2C_TX
-	movlw	0x10
-	rcall	I2C_TX
-	bsf		SSP1CON2,PEN				; Stop condition
-	rcall   WaitMSSP
-	bcf		PIR1,SSP1IF
-	bsf		SSP1CON2,SEN				; Start condition
-	rcall	WaitMSSP
-	movlw	0x3D						; address
-	rcall	I2C_TX
-	rcall	I2C_OneByteRX					; Get one byte
-	movlw	"H"						; ASCI "H" = Compass0
-	cpfseq	SSP1BUF
-	bcf	compass_enabled					; clear enable flag, neither Compass2, 1 or 0 was found properly
-	bsf		SSP1CON2,PEN				; Stop condition
-	rcall	WaitMSSP
-
-	
 ; init compass0
-	btfss	compass_enabled					; Compass enabled?
-	return							; No, return
 	bsf		SSP1CON2,SEN				; Start condition
 	rcall	WaitMSSP
 	movlw	0x3C						; address
@@ -612,8 +582,6 @@
 
 	global	I2C_sleep_compass
 I2C_sleep_compass:
-    	btfss	compass_enabled					; Compass enabled?
-	return							; No, return
 	bcf		 compass_enabled
 	btfsc	compass_type2				; compass2?
 	bra		I2C_sleep_compass2			; yes
@@ -754,9 +722,6 @@
     
 	global	I2C_init_accelerometer
 I2C_init_accelerometer:
-    	btfss	compass_enabled					; Compass enabled?
-	return							; No, return
-
 	btfsc	compass_type2				; compass2?
 	bra		I2C_init_accelerometer2		; Yes.