changeset 801:ba084dfa4b36

minor
author heinrichsweikamp
date Sat, 11 Oct 2014 11:18:15 +0200
parents afcf56ae09e4
children 798c1acb750a
files code_part1/OSTC_code_asm_part1/divemode.asm
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/divemode.asm	Fri Oct 10 17:30:32 2014 +0200
+++ b/code_part1/OSTC_code_asm_part1/divemode.asm	Sat Oct 11 11:18:15 2014 +0200
@@ -65,6 +65,8 @@
 	btfss	onesecupdate					; tasks any new second
 	bra		diveloop_loop3
 
+    bcf     onesecupdate					; one seconds update, clear flag here in case it's set again in ISR before all tasks are done.
+
 	btfsc	gauge_mode						; Only in gauge mode
 	bra		diveloop_loop1a					; One Second Tasks in Gauge mode
 	btfsc	FLAG_apnoe_mode					; Only in apnoe mode
@@ -168,8 +170,6 @@
 	btfsc	enter_error_sleep				; Enter Fatal Error Routine?
 	call	fatal_error_sleep				; Yes (In Sleepmode.asm!)
 
-	bcf		onesecupdate					; one seconds update done
-
 diveloop_loop3:
 	btfss	menubit							; Divemode menu active?
 	call	test_switches_divemode			; No, Check switches normal
@@ -1683,6 +1683,13 @@
 	goto	surfloop_no_display_init	; and return to surfaceloop
 
 end_dive_common_sim:
+    tstfsz  surface_interval+0              ; Was interval zero?
+    bra     end_dive_common_sim2            ; No
+    tstfsz  surface_interval+1              ; Was interval zero?
+    bra     end_dive_common_sim2            ; No
+    bra     end_dive_common                 ; Yes, done.
+
+end_dive_common_sim2:
     movf    divemins+0,W
     addwf   surface_interval+0,F
     movf    divemins+1,W