diff 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
line wrap: on
line diff
--- a/src/sleepmode.asm	Mon Jul 14 15:17:07 2014 +0200
+++ b/src/sleepmode.asm	Tue Jul 15 10:20:37 2014 +0200
@@ -52,16 +52,14 @@
     bcf     enable_screen_dumps     ; =1: Ignore vin_usb, wait for "l" command (Screen dump)
 	clrf	ADCON0					; Power-Down ADC Module
 sleeploop_loop:
-	btfsc	onehourupdate			; one hour in sleep?
-	call	update_battery_registers;update battery registers into EEPROM
-    btfsc	onehourupdate			; one hour in sleep?
-    call    vault_decodata_into_eeprom  ; update deco data
+	btfsc	onesecupdate			; one second in sleep?
+	rcall	onesec_sleep			; check switches, check pressure sensor, etc.
 
 	btfsc	oneminupdate			; one minute in sleep?
 	rcall	onemin_sleep			; do oneminute tasks, e.g. calculate desaturation
 
-	btfsc	onesecupdate			; one second in sleep?
-	rcall	onesec_sleep			; check switches, check pressure sensor, etc.
+	btfsc	onehourupdate			; one hour in sleep?
+    rcall   onehour_sleep           ; Yes
 
 	btfss	sleepmode				; wake up? (This bit will be set in other routines)
 	goto	restart					; yes
@@ -79,6 +77,11 @@
 
 	bra		sleeploop_loop			; do loop until someting happens
 
+onehour_sleep:
+    call	update_battery_registers    ; update battery registers into EEPROM
+    call    vault_decodata_into_eeprom  ; update deco data
+    bcf		onehourupdate               ; all done
+    return
 
 onemin_sleep:
     ;---- adjust airpressure compensation any 15 minutes