Mercurial > public > hwos_code
comparison src/divemode.asm @ 643:7d8a4c60ec1a
3.15 release
author | heinrichsweikamp |
---|---|
date | Mon, 24 May 2021 18:40:53 +0200 |
parents | 8c1f1f334275 |
children | 070528a88715 357341239438 |
comparison
equal
deleted
inserted
replaced
642:a9a0188091e4 | 643:7d8a4c60ec1a |
---|---|
231 | 231 |
232 ;----------------------------------------------------------------------------- | 232 ;----------------------------------------------------------------------------- |
233 ; Dive Mode Mail Loop | 233 ; Dive Mode Mail Loop |
234 ; | 234 ; |
235 diveloop_loop: | 235 diveloop_loop: |
236 btfsc trigger_full_second ; new 1/1 second? | 236 btfss trigger_quarter_second ; new 1/4 second? |
237 bra diveloop_loop_0 ; No - continue | |
238 | |
239 ;---- tasks any new 1/4 second ----- | |
240 bcf trigger_quarter_second ; YES - clear flag | |
241 | |
242 movlw .4 ; 62,5ms * 4 = 1/4 second | |
243 movff WREG,isr_tmr7_helper ; to make sure at least 1/4 will pass before trigger_quarter_second is re-set | |
244 | |
245 btfss press_sensor_type ; New sensor found? | |
246 bra diveloop_loop_0 ; No - continue | |
247 | |
248 ; Handle new pressure sensor every 1/4 second | |
249 btfsc ms5837_state ; =0: result of temperature is in the ADC | |
250 bra diveloop_loop_quarter_2 | |
251 call I2C_get_temp_val_MS5837 ; (Will set ms5837_state) | |
252 bra diveloop_loop_0 ; Done. | |
253 diveloop_loop_quarter_2: | |
254 call I2C_get_press_val_MS5837 ; (Will clear ms5837_state) | |
255 ;---- tasks any new 1/4 second done ----- | |
256 | |
257 diveloop_loop_0: | |
258 btfsc trigger_full_second ; new 1/1 second? | |
237 bra diveloop_loop_2 ; YES - continue with tasks every 1/1 second | 259 bra diveloop_loop_2 ; YES - continue with tasks every 1/1 second |
238 btfsc trigger_half_second ; NO - new 1/2 second? | 260 btfsc trigger_half_second ; NO - new 1/2 second? |
239 bra diveloop_loop_1 ; YES - continue with tasks every 1/2 second | 261 bra diveloop_loop_1 ; YES - continue with tasks every 1/2 second |
240 | 262 |
241 ; tasks every round except every 1/1 or 1/2 second | 263 ; tasks every round except every 1/1 or 1/2 second |
463 call divemenu_cleanup ; clean up menu area and restore dive data | 485 call divemenu_cleanup ; clean up menu area and restore dive data |
464 ;bra diveloop_loop_12 ; continue the dive loop | 486 ;bra diveloop_loop_12 ; continue the dive loop |
465 | 487 |
466 | 488 |
467 diveloop_loop_12: | 489 diveloop_loop_12: |
468 bsf FLAG_TFT_active_gas_divemode; redraw gas and setpoint (eventually needed to restore the "Bailout" text) | 490 bsf FLAG_TFT_active_gas_divemode; redraw gas and setpoint (eventually needed to restore the "Bailout" text) |
469 | 491 |
470 btfsc request_next_custview ; shall show next custom view? | 492 btfsc request_next_custview ; shall show next custom view? |
471 call dive_customview_toggle ; YES - show next custom view | 493 call dive_customview_toggle ; YES - show next custom view |
472 | 494 |
473 btfsc request_gas_change ; shall change gas? | 495 btfsc request_gas_change ; shall change gas? |