Mercurial > public > hwos_code
comparison src/sleepmode.asm @ 448:aadfe9f2edaf
work on new battery options
author | heinrichsweikamp |
---|---|
date | Tue, 30 Aug 2016 17:26:21 +0200 |
parents | 4389fe9673b2 |
children | 8dfb93e80338 |
comparison
equal
deleted
inserted
replaced
447:f2a1d535347f | 448:aadfe9f2edaf |
---|---|
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 rechargeable | 128 btfsc battery_gauge_available |
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 rechargeable | 148 btfsc battery_gauge_available |
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: |