diff src/surfmode.asm @ 188:ebc28381f17d

NEW: Show Bailout Gas List in Surface mode (CCR Modes) CHANGE: Faster update rate for sensor display in surface mode
author heinrichsweikamp
date Mon, 27 Oct 2014 11:28:48 +0100
parents 669b5d00706d
children e79bc535ef9e
line wrap: on
line diff
--- a/src/surfmode.asm	Sat Oct 25 15:28:18 2014 +0200
+++ b/src/surfmode.asm	Mon Oct 27 11:28:48 2014 +0100
@@ -177,8 +177,6 @@
 	call	TFT_clock					; update clock
 	call	timeout_surfmode			; check timeout 
 	call	get_battery_voltage			; get battery voltage
-    call    compute_ppo2                ; compute mv_sensorX and ppo2_sensorX arrays
-    call    check_sensors               ; Set enable/disable flags
 	call	TFT_update_batt_voltage		; display battery voltage
 	call	set_dive_modes				; tests if depth>threshold
     btfss   secs,0                      ; Every two seconds...
@@ -186,9 +184,6 @@
     btfss   secs,0                      ; Every two seconds...
     call    surfmode_check_for_warnings ; ... check for warnings (and display/update) them
 
-    btfsc   FLAG_ccr_mode               ; In CCR mode...
-    call    TFT_surface_hud             ; ...update HUD data in surface mode
-
 	bcf		onesecupdate				; every second tasks done
 	
 surfloop_loop2:	
@@ -208,9 +203,18 @@
 	call	TFT_update_surf_press		; display surface pressure
 	bcf		pressure_refresh			; until new pressure is available
 
+; Updates every 1/4 second
     btfss   quarter_second_update
     bra     surfloop_loop2a
+
     bcf     quarter_second_update
+    ; Update Sensors
+
+    call    compute_ppo2                ; compute mv_sensorX and ppo2_sensorX arrays
+    call    check_sensors               ; Set enable/disable flags
+    btfsc   FLAG_ccr_mode               ; In CCR mode...
+    call    TFT_surface_sensor          ; ...update sensor data in surface mode
+
     movlw   .6
     cpfseq  menupos3                    ; in compass view?
     bra     surfloop_loop2a             ; No
@@ -350,9 +354,16 @@
 
 	global	timeout_surfmode
 timeout_surfmode:
-	movlw	timeout_surfacemode		; [s]
+	movlw	timeout_surfacemode		; [s] Default timeout
     btfsc   menu_show_sensors2      ; In the "Calibrate" menu?
-    movlw   timeout_calibrate_menu  ; [s]
+    movlw   timeout_calibrate_menu  ; [s] CCR Calibrate Menu timeout
+    btfsc   menubit                 ; in Menu?
+    bra     timeout_testmode        ; No, done.
+    ; Must be in surface mode
+    btfss   FLAG_ccr_mode           ; =1: CCR mode (Fixed ppO2 or Sensor) active
+    bra     timeout_testmode        ; No, not CCR
+    movlw   timeout_ccr_surface     ; [s] CCR Surface mode timeout
+
 	global	timeout_testmode
 timeout_testmode:
 	incf	timeout_counter2,F		; increase timeout counter