Mercurial > public > mk2
changeset 162:fdebc43c8372
Fix altimeter auto-reset
author | JeanDo |
---|---|
date | Fri, 21 Jan 2011 01:48:40 +0100 |
parents | 8d6aca08f66b |
children | 144822282fa3 |
files | code_part1/OSTC_code_asm_part1/altimeter.asm |
diffstat | 1 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/altimeter.asm Tue Jan 18 23:57:33 2011 +0100 +++ b/code_part1/OSTC_code_asm_part1/altimeter.asm Fri Jan 21 01:48:40 2011 +0100 @@ -29,10 +29,15 @@ altimeter_calc: movlb HIGH(pressureAvg) - movf pressureRef+0,W ; Already initialized ? - iorwf pressureRef+1,W - bnz altimeter_1 ; Yes... - + movlw HIGH(4*.1100) ; Is presure ref lower than 900mbar + cpfslt pressureRef+1 + bra altimeter_1 ; No: ok it is valid... + + movlw HIGH(4*.1100) ; Is ref pressure bigger than 1100mbar ? + cpfsgt pressureRef+1 + bra altimeter_1 ; No: ok it is valid... + +altimeter_0: movlw LOW(4*.1013+1) ; Init see level at 1013,25 mbar. movwf pressureRef+0 movlw HIGH(4*.1013+1)