diff code_part1/OSTC_code_asm_part1/simulator.asm @ 575:cbdcbbc91877

some code cleaning
author heinrichsweikamp
date Sat, 21 Apr 2012 15:08:09 +0200
parents 3091628b2742
children ab2686087bce
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/simulator.asm	Sat Apr 21 13:58:30 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/simulator.asm	Sat Apr 21 15:08:09 2012 +0200
@@ -63,17 +63,10 @@
 menu_simulator_loop:
 	call	check_switches_menu
 menu_simulator_loop2:
-	btfss	onesecupdate
-	bra		menu_simulator_loop3
-
-	call	timeout_surfmode
-	call	set_dive_modes
-	call	test_charger				; check if charger IC is active
-	call	get_battery_voltage			; get battery voltage
-	
+	btfsc	onesecupdate
+	call	menu_check_dive_and_timeout	; "Goto restart" or sets sleepmode flag
 	bcf		onesecupdate				; End of one second tasks
 
-menu_simulator_loop3:
 	btfsc	menubit2
 	goto	menu_simulator_do			; call submenu
 
@@ -83,9 +76,6 @@
 	btfsc	sleepmode
 	goto	menu_simulator_exit
 
-	btfsc	divemode
-	goto	restart						; exit menu, restart and enter divemode
-
 	bra		menu_simulator_loop
 
 menu_simulator_do:						; calls submenu
@@ -248,18 +238,13 @@
         bcf		switch_left
         bcf		switch_right
 simulator_show_decoplan2:
-        btfsc	uart_dump_screen        ; Asked to dump screen contains ?
-        call	dump_screen             ; Yes!
-        
-        btfss	onesecupdate
-        bra		simulator_show_decoplan3
+	btfsc	uart_dump_screen        ; Asked to dump screen contains ?
+	call	dump_screen             ; Yes!
         
-        call	timeout_surfmode
-        call	set_dive_modes
-        call	test_charger            ; check if charger IC is active
-        call	get_battery_voltage     ; get battery voltage
-        
-        bcf		onesecupdate            ; End of one second tasks
+	btfsc	onesecupdate
+	call	menu_check_dive_and_timeout	; "Goto restart" or sets sleepmode flag
+      
+    bcf		onesecupdate            ; End of one second tasks
 
 simulator_show_decoplan3:
 	btfsc	switch_right
@@ -271,9 +256,6 @@
 	btfsc	sleepmode
 	goto	more_menu
 
-	btfsc	divemode
-	goto	restart						; exit menu, restart and enter divemode
-
 	bra		simulator_show_decoplan2
 
 simulator_show_decoplan5: