changeset 213:d19445e0cb2f

BUGFIX Altimeter reset when exiting sleep mode (bug#&6).
author JeanDo
date Wed, 23 Feb 2011 00:18:41 +0100
parents 275befc5f39d
children 8a0bbe43df65
files code_part1/OSTC_code_asm_part1/altimeter.asm code_part1/OSTC_code_asm_part1/sleepmode.asm
diffstat 2 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/altimeter.asm	Mon Feb 21 22:36:48 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/altimeter.asm	Wed Feb 23 00:18:41 2011 +0100
@@ -31,14 +31,13 @@
         
         movlw   HIGH(4*.900)            ; Is presure ref bigger than 900mbar
         cpfsgt  pressureRef+1
-        bra     altimeter_reset         ; No: Should do a reset now.
+        bra     altimeter_restart       ; No: Should do a reset now.
         
         movlw   HIGH(4*.1100)           ; Is ref pressure bigger than 1100mbar ?
         cpfsgt  pressureRef+1
         bra     altimeter_1             ; No: ok it is valid...
 
-; Reset computation. Eg. after a sleep, enables to faster restart with correct
-; values...
+; Reset calibration value to default.
 altimeter_reset:
         movlb   HIGH(pressureAvg)
         movlw   LOW(4*.1013+1)          ; Init see level at 1013,25 mbar.
@@ -46,6 +45,9 @@
         movlw   HIGH(4*.1013+1)
         movwf   pressureRef+1
 
+; Restart averaging. Eg. after a sleep, enables to faster restart with correct
+; values...
+altimeter_restart:
         clrf    pressureSum+0           ; Init averaging area
         clrf    pressureSum+1
         clrf    pressureCount
@@ -360,7 +362,6 @@
 ;---- Reset sea level pressure to reference ----------------------------------
 alt_menu_reset:
         rcall       altimeter_reset
-        movlb       1                   ; Go back to normal bank1
         bra         altimeter_menu_2
         
 ;---- Increment sea level pressure -------------------------------------------        
--- a/code_part1/OSTC_code_asm_part1/sleepmode.asm	Mon Feb 21 22:36:48 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/sleepmode.asm	Wed Feb 23 00:18:41 2011 +0100
@@ -169,8 +169,8 @@
 	bcf		sleepmode				; wake up!
 	bsf		show_startup_screen		;
 
-    ; Reset altimeter, so next averaging starts right over...
-	call    altimeter_reset
+    ; Restart altimeter averaging, so next averaging starts right over...
+	call    altimeter_restart
 
 	return