comparison 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
comparison
equal deleted inserted replaced
187:669b5d00706d 188:ebc28381f17d
175 call speed_normal 175 call speed_normal
176 call TFT_debug_output 176 call TFT_debug_output
177 call TFT_clock ; update clock 177 call TFT_clock ; update clock
178 call timeout_surfmode ; check timeout 178 call timeout_surfmode ; check timeout
179 call get_battery_voltage ; get battery voltage 179 call get_battery_voltage ; get battery voltage
180 call compute_ppo2 ; compute mv_sensorX and ppo2_sensorX arrays
181 call check_sensors ; Set enable/disable flags
182 call TFT_update_batt_voltage ; display battery voltage 180 call TFT_update_batt_voltage ; display battery voltage
183 call set_dive_modes ; tests if depth>threshold 181 call set_dive_modes ; tests if depth>threshold
184 btfss secs,0 ; Every two seconds... 182 btfss secs,0 ; Every two seconds...
185 call TFT_temp_surfmode ; Displays temperature 183 call TFT_temp_surfmode ; Displays temperature
186 btfss secs,0 ; Every two seconds... 184 btfss secs,0 ; Every two seconds...
187 call surfmode_check_for_warnings ; ... check for warnings (and display/update) them 185 call surfmode_check_for_warnings ; ... check for warnings (and display/update) them
188 186
189 btfsc FLAG_ccr_mode ; In CCR mode...
190 call TFT_surface_hud ; ...update HUD data in surface mode
191
192 bcf onesecupdate ; every second tasks done 187 bcf onesecupdate ; every second tasks done
193 188
194 surfloop_loop2: 189 surfloop_loop2:
195 ; Tasks approx. every 50ms for all modes 190 ; Tasks approx. every 50ms for all modes
196 call test_switches_surfmode ; check switches 191 call test_switches_surfmode ; check switches
206 201
207 btfsc pressure_refresh ; new pressure available? 202 btfsc pressure_refresh ; new pressure available?
208 call TFT_update_surf_press ; display surface pressure 203 call TFT_update_surf_press ; display surface pressure
209 bcf pressure_refresh ; until new pressure is available 204 bcf pressure_refresh ; until new pressure is available
210 205
206 ; Updates every 1/4 second
211 btfss quarter_second_update 207 btfss quarter_second_update
212 bra surfloop_loop2a 208 bra surfloop_loop2a
209
213 bcf quarter_second_update 210 bcf quarter_second_update
211 ; Update Sensors
212
213 call compute_ppo2 ; compute mv_sensorX and ppo2_sensorX arrays
214 call check_sensors ; Set enable/disable flags
215 btfsc FLAG_ccr_mode ; In CCR mode...
216 call TFT_surface_sensor ; ...update sensor data in surface mode
217
214 movlw .6 218 movlw .6
215 cpfseq menupos3 ; in compass view? 219 cpfseq menupos3 ; in compass view?
216 bra surfloop_loop2a ; No 220 bra surfloop_loop2a ; No
217 call TFT_surface_compass_heading ; Yes, update compass heading value 221 call TFT_surface_compass_heading ; Yes, update compass heading value
218 222
348 clrf timeout_counter2 ; and reset timeout 352 clrf timeout_counter2 ; and reset timeout
349 return 353 return
350 354
351 global timeout_surfmode 355 global timeout_surfmode
352 timeout_surfmode: 356 timeout_surfmode:
353 movlw timeout_surfacemode ; [s] 357 movlw timeout_surfacemode ; [s] Default timeout
354 btfsc menu_show_sensors2 ; In the "Calibrate" menu? 358 btfsc menu_show_sensors2 ; In the "Calibrate" menu?
355 movlw timeout_calibrate_menu ; [s] 359 movlw timeout_calibrate_menu ; [s] CCR Calibrate Menu timeout
360 btfsc menubit ; in Menu?
361 bra timeout_testmode ; No, done.
362 ; Must be in surface mode
363 btfss FLAG_ccr_mode ; =1: CCR mode (Fixed ppO2 or Sensor) active
364 bra timeout_testmode ; No, not CCR
365 movlw timeout_ccr_surface ; [s] CCR Surface mode timeout
366
356 global timeout_testmode 367 global timeout_testmode
357 timeout_testmode: 368 timeout_testmode:
358 incf timeout_counter2,F ; increase timeout counter 369 incf timeout_counter2,F ; increase timeout counter
359 cpfsgt timeout_counter2 ; Compare with timeout_counter2 370 cpfsgt timeout_counter2 ; Compare with timeout_counter2
360 return ; return, no timeout 371 return ; return, no timeout