comparison src/sleepmode.asm @ 200:dcd513840c6c

cleanup
author heinrichsweikamp
date Wed, 12 Nov 2014 19:33:15 +0100
parents c511dc403d7e
children 618191753d2b
comparison
equal deleted inserted replaced
199:800f09c9089c 200:dcd513840c6c
123 123
124 onesec_sleep: 124 onesec_sleep:
125 btfsc oneminupdate ; one minute in sleep? 125 btfsc oneminupdate ; one minute in sleep?
126 rcall onemin_sleep ; do oneminute tasks, e.g. calculate desaturation 126 rcall onemin_sleep ; do oneminute tasks, e.g. calculate desaturation
127 127
128 btfsc c3_hardware 128 btfsc cr_hardware
129 call get_battery_voltage ; Check for charger 129 call get_battery_voltage ; Check for charger
130 130
131 incf divemins+0,F ; counts to #test_pressure_in_sleep (5) 131 incf divemins+0,F ; counts to #test_pressure_in_sleep (5)
132 movlw d'5' 132 movlw d'5'
133 cpfsgt divemins+0 ; here: temp variable 133 cpfsgt divemins+0 ; here: temp variable
143 SAFE_2BYTE_COPY amb_pressure, sub_b 143 SAFE_2BYTE_COPY amb_pressure, sub_b
144 call subU16 ; Is (1160mbar - averaged(amb_pressure)) < 0 ? 144 call subU16 ; Is (1160mbar - averaged(amb_pressure)) < 0 ?
145 btfsc neg_flag ; Wake up from Sleep? 145 btfsc neg_flag ; Wake up from Sleep?
146 bra onesec_sleep1a ; Yes, skip button checks, wake up! 146 bra onesec_sleep1a ; Yes, skip button checks, wake up!
147 147
148 btfsc c3_hardware 148 btfsc cr_hardware
149 bra onesec_sleep1 ; No wake-up with c3 hardware 149 bra onesec_sleep1 ; No wake-up with cR hardware
150 btfsc vusb_in ; USB plugged in? 150 btfsc vusb_in ; USB plugged in?
151 bra onesec_sleep1a ; Yes, skip button checks, wake up! 151 bra onesec_sleep1a ; Yes, skip button checks, wake up!
152 152
153 onesec_sleep1: 153 onesec_sleep1:
154 bcf onesecupdate ; all done. 154 bcf onesecupdate ; all done.