comparison src/sleepmode.asm @ 134:4574aed5cd4c

Show clock in Apnea mode, minor layout changes in Apnea mode
author heinrichsweikamp
date Tue, 15 Jul 2014 10:20:37 +0200
parents 939f1e83c4c2
children c511dc403d7e
comparison
equal deleted inserted replaced
133:939f1e83c4c2 134:4574aed5cd4c
50 call speed_normal 50 call speed_normal
51 bsf no_sensor_int ; No sensor interrupt 51 bsf no_sensor_int ; No sensor interrupt
52 bcf enable_screen_dumps ; =1: Ignore vin_usb, wait for "l" command (Screen dump) 52 bcf enable_screen_dumps ; =1: Ignore vin_usb, wait for "l" command (Screen dump)
53 clrf ADCON0 ; Power-Down ADC Module 53 clrf ADCON0 ; Power-Down ADC Module
54 sleeploop_loop: 54 sleeploop_loop:
55 btfsc onehourupdate ; one hour in sleep? 55 btfsc onesecupdate ; one second in sleep?
56 call update_battery_registers;update battery registers into EEPROM 56 rcall onesec_sleep ; check switches, check pressure sensor, etc.
57 btfsc onehourupdate ; one hour in sleep?
58 call vault_decodata_into_eeprom ; update deco data
59 57
60 btfsc oneminupdate ; one minute in sleep? 58 btfsc oneminupdate ; one minute in sleep?
61 rcall onemin_sleep ; do oneminute tasks, e.g. calculate desaturation 59 rcall onemin_sleep ; do oneminute tasks, e.g. calculate desaturation
62 60
63 btfsc onesecupdate ; one second in sleep? 61 btfsc onehourupdate ; one hour in sleep?
64 rcall onesec_sleep ; check switches, check pressure sensor, etc. 62 rcall onehour_sleep ; Yes
65 63
66 btfss sleepmode ; wake up? (This bit will be set in other routines) 64 btfss sleepmode ; wake up? (This bit will be set in other routines)
67 goto restart ; yes 65 goto restart ; yes
68 66
69 rcall sleepmode_sleep ; Wait at least 35ms (every 62,5ms Timer7 wakeup) 67 rcall sleepmode_sleep ; Wait at least 35ms (every 62,5ms Timer7 wakeup)
77 btfss sleepmode ; wake up? (This bit will be set in other routines) 75 btfss sleepmode ; wake up? (This bit will be set in other routines)
78 goto restart ; yes 76 goto restart ; yes
79 77
80 bra sleeploop_loop ; do loop until someting happens 78 bra sleeploop_loop ; do loop until someting happens
81 79
80 onehour_sleep:
81 call update_battery_registers ; update battery registers into EEPROM
82 call vault_decodata_into_eeprom ; update deco data
83 bcf onehourupdate ; all done
84 return
82 85
83 onemin_sleep: 86 onemin_sleep:
84 ;---- adjust airpressure compensation any 15 minutes 87 ;---- adjust airpressure compensation any 15 minutes
85 incf divemins+1,F ; counts to 14... 88 incf divemins+1,F ; counts to 14...
86 movlw d'14' 89 movlw d'14'