Mercurial > public > mk2
diff code_part1/OSTC_code_asm_part1/sleepmode.asm @ 357:562f1bc79f3c 64kByte Logbook
Bugfix: Wake-up into divemode with 1.91alpha
author | Heinrichsweikamp |
---|---|
date | Tue, 07 Jun 2011 13:06:14 +0200 |
parents | 2144f19fa1eb |
children | 88660a400338 |
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/sleepmode.asm Mon Jun 06 18:50:26 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/sleepmode.asm Tue Jun 07 13:06:14 2011 +0200 @@ -72,6 +72,8 @@ rcall pressuretest_sleep_fast ; Gets pressure without averaging (faster!) + SAFE_2BYTE_COPY amb_pressure_avg, amb_pressure ; copy for compatibility + call check_temp_extrema ; Check for temperature extremas call deco_calc_CNS_decrease_15min ; compute CNS decay in sleep only @@ -132,7 +134,7 @@ GETCUSTOM15 d'6' ; loads pressure threshold into lo,hi movff lo,sub_a+0 ; power on if ambient pressure is greater threshold movff hi,sub_a+1 - SAFE_2BYTE_COPY amb_pressure, sub_b + SAFE_2BYTE_COPY amb_pressure_avg, sub_b call sub16 ; sub_c = sub_a - sub_b bsf sleepmode btfsc neg_flag ; Wake up from Sleep? @@ -179,6 +181,8 @@ nop sleep ; Wait at least 35ms (every 16.5ms Timer1 wakeup) call get_pressure_value ; State2: Get pressure (51us) + clrf amb_pressure_avg+0 + clrf amb_pressure_avg+1 ; clear for sleep routine call calculate_compensation ; calculate temperature compensated pressure (233us) return