comparison src/sleepmode.asm @ 235:23311219dacc

under construction: new hardware_flag to configure different hardware versions
author heinrichsweikamp
date Wed, 25 Feb 2015 16:49:59 +0100
parents 5a4801918be9
children 653a3ab08062
comparison
equal deleted inserted replaced
234:57155164faad 235:23311219dacc
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 cr_hardware 128 btfsc rechargeable
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 cr_hardware 148 btfsc rechargeable
149 bra onesec_sleep1 ; No wake-up with cR 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: