Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/sleepmode.asm @ 813:c87b9f2fb2f6
wakeup from deep sleep mode automatically upon USB connect
author | heinrichsweikamp |
---|---|
date | Tue, 14 Apr 2015 14:50:11 +0200 |
parents | c50296c3059e |
children | 2a0e5d884fc3 |
comparison
equal
deleted
inserted
replaced
812:86efd57c158c | 813:c87b9f2fb2f6 |
---|---|
62 | 62 |
63 | 63 |
64 onemin_sleep: | 64 onemin_sleep: |
65 call get_battery_voltage ; get battery voltage | 65 call get_battery_voltage ; get battery voltage |
66 btfsc enter_error_sleep ; Enter Fatal Error Routine? | 66 btfsc enter_error_sleep ; Enter Fatal Error Routine? |
67 call fatal_error_sleep ; Yes (In Sleepmode_vxx.asm!) | 67 goto fatal_error_sleep ; Yes (In Sleepmode_vxx.asm!) |
68 | 68 |
69 ;---- adjust airpressure compensation any 15 minutes | 69 ;---- adjust airpressure compensation any 15 minutes |
70 incf divemins+1,F ; counts to 14... | 70 incf divemins+1,F ; counts to 14... |
71 movlw d'14' | 71 movlw d'14' |
72 cpfsgt divemins+1 | 72 cpfsgt divemins+1 |
212 bra fatal_error_sleep_loop1 | 212 bra fatal_error_sleep_loop1 |
213 fatal_error_sleep_loop2: | 213 fatal_error_sleep_loop2: |
214 call get_battery_voltage ; get battery voltage | 214 call get_battery_voltage ; get battery voltage |
215 btfss enter_error_sleep ; REALLY enter Fatal Error Routine? | 215 btfss enter_error_sleep ; REALLY enter Fatal Error Routine? |
216 goto restart ; No | 216 goto restart ; No |
217 | |
218 btfss CHRG_IN ; If CHRG_IN=0 -> CC active | |
219 goto restart ; wake up | |
220 | |
217 bsf LED_red | 221 bsf LED_red |
218 clrwdt | 222 clrwdt |
219 WAIT10US d'5' | 223 WAIT10US d'5' |
220 bcf LED_red | 224 bcf LED_red |
221 sleep | 225 sleep |