diff src/ms5541.asm @ 631:185ba2f91f59

3.09 beta 1 release
author heinrichsweikamp
date Fri, 28 Feb 2020 15:45:07 +0100
parents 4cd81bdbf15c
children 4050675965ea
line wrap: on
line diff
--- a/src/ms5541.asm	Fri Feb 21 10:51:36 2020 +0100
+++ b/src/ms5541.asm	Fri Feb 28 15:45:07 2020 +0100
@@ -1,6 +1,6 @@
 ;=============================================================================
 ;
-;   File ms5541.asm                           combined next generation V3.0.3b
+;   File ms5541.asm                           combined next generation V3.8.6
 ;
 ;   Sensor subroutines
 ;
@@ -116,8 +116,8 @@
 	movf	isr_xC+2,W
 	addwfc	SENS+1,F
 
-	; calculate absolute pressure = (sens * (d1-off))/2^12 + 1000 (For MS5541C)
-	; calculate absolute pressure = (sens * (d1-off))/2^11 + 1000 (For MS5541C-30)
+	; calculate absolute pressure = (sens * (d1-off))/2^12 + 1000 (for MS5541C)
+	; calculate absolute pressure = (sens * (d1-off))/2^11 + 1000 (for MS5541C-30)
 	movf	OFF+0,W						; d1-off --> a
 	subwf	D1+0,W
 	movwf	isr_xA+0
@@ -128,17 +128,14 @@
 	MOVII	SENS,isr_xB					; sens --> b
 	call	isr_signed_mult16x16
 	movlw	.13
-	cpfslt	C1+1		; C1 > 3328 (Must be MS5541-30)
-	bra	isr_shift_ms5541_30
-	; MS5541
-	movlw	.12-.8						; a 12 bit shift = 1 byte + 4 bits
+	cpfslt	C1+1						; C1 > 3328 ?
+	bra		isr_shift_ms5541_30			; YES - MS5541-30
+	movlw	.12-.8						; NO  - MS5541: 12 bit shift = 1 byte + 4 bits
+	bra		isr_shift_ms5541_common
+isr_shift_ms5541_30:
+	movlw	.11-.8						; MS5541-30:    11 bit shift = 1 byte + 3 bits
+isr_shift_ms5541_common:
 	call	isr_shift_C31
-	bra	isr_shift_ms5541_all
-isr_shift_ms5541_30:
-	; MS5541-30
-    	movlw	.11-.8						; a 11 bit shift = 1 byte + 3 bits
-	call	isr_shift_C31
-isr_shift_ms5541_all:
 	movlw	LOW  .1000					; add 1000
 	addwf	isr_xC+1,F
 	movlw	HIGH .1000