Mercurial > public > hwos_code
comparison src/divemode.asm @ 605:5ce603c29750
gas color coding fixed
author | heinrichsweikamp |
---|---|
date | Sun, 25 Nov 2018 13:21:52 +0100 |
parents | ca4556fb60b9 |
children | 8b250afb8bdd |
comparison
equal
deleted
inserted
replaced
604:ca4556fb60b9 | 605:5ce603c29750 |
---|---|
172 call get_pressure_readings ; YES - get pressure readings | 172 call get_pressure_readings ; YES - get pressure readings |
173 call configure_sac_calculation ; - set up SAC calculation | 173 call configure_sac_calculation ; - set up SAC calculation |
174 diveloop_loop1_deco1: | 174 diveloop_loop1_deco1: |
175 ENDIF | 175 ENDIF |
176 | 176 |
177 call calc_deko_divemode ; calculate decompression and set resulting display flags | 177 call calc_deco_divemode ; calculate decompression and set resulting display flags |
178 | 178 |
179 btfss alternative_divelayout | 179 btfss alternative_divelayout |
180 rcall TFT_output2_normal | 180 rcall TFT_output2_normal |
181 btfsc alternative_divelayout | 181 btfsc alternative_divelayout |
182 rcall TFT_output2_alternative | 182 rcall TFT_output2_alternative |
390 movff max_pressure+1,apnoe_max_pressure+1 | 390 movff max_pressure+1,apnoe_max_pressure+1 |
391 return | 391 return |
392 | 392 |
393 ; -------------------------------------------------------------------------------------- | 393 ; -------------------------------------------------------------------------------------- |
394 | 394 |
395 calc_deko_divemode: | 395 calc_deco_divemode: |
396 btfss FLAG_gauge_mode ; in gauge mode? | 396 btfss FLAG_gauge_mode ; in gauge mode? |
397 rcall calc_deko_engine ; NO - do deco calculations | 397 rcall calc_deko_engine ; NO - do deco calculations |
398 | 398 |
399 ; Increment the time accumulators used for calculating the average depths. | 399 ; Increment the time accumulators used for calculating the average depths. |
400 ; This done here and not in the ISR to guarantee synchronism between time | 400 ; This done here and not in the ISR to guarantee synchronism between time |
550 clrf TMR5L ; restart timer used to preempt stops calculation | 550 clrf TMR5L ; restart timer used to preempt stops calculation |
551 clrf TMR5H ; | 551 clrf TMR5H ; |
552 call deco_calc_hauptroutine ; invoke the deco engine (p2_deco.c) | 552 call deco_calc_hauptroutine ; invoke the deco engine (p2_deco.c) |
553 banksel common | 553 banksel common |
554 | 554 |
555 ; the displayed gas may need a different color-coding | |
556 bsf FLAG_TFT_active_gas_divemode; redraw gas/setpoint/diluent | |
557 | |
555 ; check if display shall be updated due to deco engine restart | 558 ; check if display shall be updated due to deco engine restart |
556 btfsc FLAG_TFT_display_ndl_or_deko; shall update immediately? | 559 btfsc FLAG_TFT_display_ndl_or_deko; shall update immediately? |
557 bra calc_deko_engine_update ; YES | 560 bra calc_deko_engine_update ; YES |
558 | 561 |
559 ; check if new calculation results for normal plan mode are available | 562 ; check if new calculation results for normal plan mode are available |
560 movff char_O_main_status,WREG ; get deco status of deco engine | 563 movff char_O_main_status,WREG ; get deco status of deco engine |
561 btfss WREG,DECO_COMPLETED_NORM ; new calculation results for normal plan available? | 564 btfss WREG,DECO_COMPLETED_NORM ; new calculation results for normal plan available? |
562 return ; NO - done | 565 return ; NO - done |
566 | |
563 calc_deko_engine_update: | 567 calc_deko_engine_update: |
564 bcf FLAG_TFT_display_ndl_or_deko; YES - reset flag for immediate update | 568 bcf FLAG_TFT_display_ndl_or_deko; YES - reset flag for immediate update |
565 movff char_O_deco_info,WREG ; - get deco info vector | 569 movff char_O_deco_info,WREG ; - get deco info vector |
566 btfsc WREG,deco_ceiling ; - ceiling depth > 0 ? | 570 btfsc WREG,deco_ceiling ; - ceiling depth > 0 ? |
567 bra calc_deko_engine_update_deco; YES - in deco | 571 bra calc_deko_engine_update_deco; YES - in deco |
1442 bra gas_switched_common3 | 1446 bra gas_switched_common3 |
1443 gas_switched_common_OC: | 1447 gas_switched_common_OC: |
1444 rcall setup_gas_registers ; with WREG = Gas 1-6 | 1448 rcall setup_gas_registers ; with WREG = Gas 1-6 |
1445 rcall deco_setup_oc_gases ; with WREG = Gas 1-6 | 1449 rcall deco_setup_oc_gases ; with WREG = Gas 1-6 |
1446 gas_switched_common3: | 1450 gas_switched_common3: |
1447 bsf FLAG_TFT_active_gas_divemode ; redraw gas/setpoint/diluent | 1451 banksel int_O_breathed_ppO2 |
1448 call restart_deco_engine_wo_ceiling ; abort any running deco calculations and restart the deco engine | 1452 bcf int_O_breathed_ppO2+1,int_low_flag ; | clear all flags that control color-coding |
1453 bcf int_O_breathed_ppO2+1,int_high_flag ; | to have the new gas initially displayed in | |
1454 bcf int_O_breathed_ppO2+1,int_attention_flag ; | memo color instead of a warning or attention | |
1455 bcf int_O_breathed_ppO2+1,int_warning_flag ; | color that belonged to the previous gas | |
1456 banksel common | |
1457 bsf FLAG_TFT_active_gas_divemode ; redraw gas/setpoint/diluent | |
1458 call restart_deco_engine_wo_ceiling ; abort any running deco calculations and restart the deco engine | |
1449 ; set flags for profile recording | 1459 ; set flags for profile recording |
1450 bsf event_occured ; set event flag | 1460 bsf event_occured ; set event flag |
1451 btfsc FLAG_bailout_mode ; choose OC Bailouts (OC Gases) | 1461 btfsc FLAG_bailout_mode ; choose OC Bailouts (OC Gases) |
1452 bsf bailoutgas_event ; bailout gas change | 1462 bsf bailoutgas_event ; bailout gas change |
1453 btfss FLAG_bailout_mode ; choose OC Bailouts (OC Gases) | 1463 btfss FLAG_bailout_mode ; choose OC Bailouts (OC Gases) |