# HG changeset patch # User JeanDo # Date 1298418836 -3600 # Node ID 8a0bbe43df65a9b9da86cebbd0d222a6d8437f31 # Parent d19445e0cb2f532e658de98c877f81d08951691a (altimeter restart: fix bank addressing) diff -r d19445e0cb2f -r 8a0bbe43df65 code_part1/OSTC_code_asm_part1/altimeter.asm --- a/code_part1/OSTC_code_asm_part1/altimeter.asm Wed Feb 23 00:18:41 2011 +0100 +++ b/code_part1/OSTC_code_asm_part1/altimeter.asm Wed Feb 23 00:53:56 2011 +0100 @@ -23,15 +23,17 @@ ; 2010-12-15 : [jDG] First prototype with quadratic polynomial ant tp°. ; 2010-12-28 : [jDG] Use MPLAB Math and C libraries for FP32 computations. ; 2011-01-02 : [jDG] Edit reference pressure by 0.25 mbar. +; 2011-01-31 : [jDG] Better menu: default 1013mbar, and editing by +/- 1mbar. +; 2011-02-23 : [jDG] Fix restart after sleepmode. ; ; Known bug: Simulator reset altitude and reference... altimeter_calc: - movlb HIGH(pressureAvg) + movlb HIGH(pressureAvg) ; Altimeter data in bank 0. movlw HIGH(4*.900) ; Is presure ref bigger than 900mbar cpfsgt pressureRef+1 - bra altimeter_restart ; No: Should do a reset now. + bra altimeter_reset ; No: Should do a reset now. movlw HIGH(4*.1100) ; Is ref pressure bigger than 1100mbar ? cpfsgt pressureRef+1 @@ -39,7 +41,7 @@ ; Reset calibration value to default. altimeter_reset: - movlb HIGH(pressureAvg) + movlb HIGH(pressureAvg) ; Altimeter data in bank 0. movlw LOW(4*.1013+1) ; Init see level at 1013,25 mbar. movwf pressureRef+0 movlw HIGH(4*.1013+1) @@ -48,6 +50,7 @@ ; Restart averaging. Eg. after a sleep, enables to faster restart with correct ; values... altimeter_restart: + movlb HIGH(pressureAvg) ; Altimeter data in bank 0. clrf pressureSum+0 ; Init averaging area clrf pressureSum+1 clrf pressureCount