diff src/compass_ops.asm @ 647:357341239438

Merge
author heinrichs weikamp
date Thu, 14 Oct 2021 12:04:12 +0200
parents 7d8a4c60ec1a 5b7fe7777425
children ef2ed7e3a895
line wrap: on
line diff
--- a/src/compass_ops.asm	Mon May 24 18:41:51 2021 +0200
+++ b/src/compass_ops.asm	Thu Oct 14 12:04:12 2021 +0200
@@ -313,6 +313,10 @@
 ;	btfsc	compass_type1				; compass1?
 ;	bra		compass_calibration_loop3	; YES -  skip gain stuff
 
+	banksel	opt_compass_gain			; select bank options table
+	tstfsz	opt_compass_gain			; =0?
+	bra		$+4				; No
+	bra	compass_calibration_loop3		; YES -  skip gain stuff 
 	; Test all axes for +4096 (Hi byte=16)
 	banksel	compass_DX					; select bank common2
 	movlw	.16
@@ -337,19 +341,9 @@
 	cpfseq	compass_DZ+1
 	bra		$+4
 	bra		compass_calibration_gainset
-	banksel	common						; back to bank common
-
-;	; Three
-;	call	I2C_RX_compass				; read compass
-;	call	I2C_RX_accelerometer		; test accelerometer
-;	call	compass_filter				; filter compass raw data
-;
-;	; Four times to get cleaner values
-;	call	I2C_RX_compass				; read compass
-;	call	I2C_RX_accelerometer		; test accelerometer
-;	call	compass_filter				; filter compass raw data
 
 compass_calibration_loop3:
+	banksel	common						; back to bank common
 	; and register only one value out of four:
 	call	compass_add_calibration		; check and store new max/min values (C-code)
 	banksel	common						; back to bank common