Mercurial > public > hwos_code
comparison src/divemode.asm @ 654:75e90cd0c2c3
hwOS sport 10.77 release
author | heinrichsweikamp |
---|---|
date | Thu, 14 Mar 2024 16:56:46 +0100 |
parents | bc214815deb2 |
children |
comparison
equal
deleted
inserted
replaced
653:8bcd138ab744 | 654:75e90cd0c2c3 |
---|---|
2 ; | 2 ; |
3 ; File divemode.asm * combined next generation V3.12.3 | 3 ; File divemode.asm * combined next generation V3.12.3 |
4 ; | 4 ; |
5 ; Dive Mode | 5 ; Dive Mode |
6 ; | 6 ; |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | 7 ; Copyright (c) 2011, JD Gascuel, heinrichs weikamp gmbh, all right reserved. |
8 ;============================================================================= | 8 ;============================================================================= |
9 ; HISTORY | 9 ; HISTORY |
10 ; 2011-08-15 : [mH] moving from OSTC code | 10 ; 2011-08-15 : [mH] moving from OSTC code |
11 | 11 |
12 #include "hwos.inc" ; mandatory header | 12 #include "hwos.inc" ; mandatory header |
625 call TFT_show_apnoe_surface ; YES - show apnoe mode surface time | 625 call TFT_show_apnoe_surface ; YES - show apnoe mode surface time |
626 btfsc FLAG_TFT_depth_maximum_apnoe ; shall show max. depth of last dive? | 626 btfsc FLAG_TFT_depth_maximum_apnoe ; shall show max. depth of last dive? |
627 call TFT_show_apnoe_max_depth ; YES - show max. depth of last dive | 627 call TFT_show_apnoe_max_depth ; YES - show max. depth of last dive |
628 btfsc FLAG_TFT_apnoe_divetime ; shall show apnoe dive time? | 628 btfsc FLAG_TFT_apnoe_divetime ; shall show apnoe dive time? |
629 call TFT_show_apnoe_times ; YES - show apnoe dive time? | 629 call TFT_show_apnoe_times ; YES - show apnoe dive time? |
630 btfsc FLAG_TFT_depth_maximum_apnoe ; shall show max. depth of last dive? (Flag re-used here for #dive) | |
631 call TFT_apnoe_divecounter ; YES - show apnoe #dive counter? | |
630 | 632 |
631 clrf TFT_output_flags_1 ; mark all TFT updates done | 633 clrf TFT_output_flags_1 ; mark all TFT updates done |
632 return ; done | 634 return ; done |
633 | 635 |
634 | 636 |
642 call TFT_show_divetime ; YES - show dive time | 644 call TFT_show_divetime ; YES - show dive time |
643 btfsc FLAG_TFT_safety_stop_show ; shall show safety stop? | 645 btfsc FLAG_TFT_safety_stop_show ; shall show safety stop? |
644 call TFT_safety_stop_show ; YES - show safety stop | 646 call TFT_safety_stop_show ; YES - show safety stop |
645 btfsc FLAG_TFT_safety_stop_clear ; shall clear safety stop? | 647 btfsc FLAG_TFT_safety_stop_clear ; shall clear safety stop? |
646 call TFT_safety_stop_clear ; YES - clear safety stop | 648 call TFT_safety_stop_clear ; YES - clear safety stop |
649 | |
647 clrf TFT_output_flags_2 ; mark all TFT updates done | 650 clrf TFT_output_flags_2 ; mark all TFT updates done |
648 goto dive_customview_second ; do every-second tasks for the custom view area (in sync with the dive time) and return | 651 goto dive_customview_second ; do every-second tasks for the custom view area (in sync with the dive time) and return |
649 | 652 |
650 | 653 |
651 ;----------------------------------------------------------------------------- | 654 ;----------------------------------------------------------------------------- |
702 divemode_apnoe_tasks_dive: ; apnoe mode, submerged | 705 divemode_apnoe_tasks_dive: ; apnoe mode, submerged |
703 btfss apnoe_new_dive ; new dive begun? | 706 btfss apnoe_new_dive ; new dive begun? |
704 return ; NO - done | 707 return ; NO - done |
705 bcf apnoe_new_dive ; YES - clear flag | 708 bcf apnoe_new_dive ; YES - clear flag |
706 bsf FLAG_TFT_clear_apnoe_surface ; - clear apnoe mode surface data from screen | 709 bsf FLAG_TFT_clear_apnoe_surface ; - clear apnoe mode surface data from screen |
710 incf apnoe_dive_counter,F ; Increase #dive counter | |
707 return ; - done | 711 return ; - done |
708 | 712 |
709 divemode_apnoe_tasks_surf: ; apnoe mode, at the surface | 713 divemode_apnoe_tasks_surf: ; apnoe mode, at the surface |
710 bsf FLAG_TFT_apnoe_surface_time ; show apnoe mode surface time | 714 bsf FLAG_TFT_apnoe_surface_time ; show apnoe mode surface time |
711 ; TODO: these outputs would need to be done only once after surfacing... | 715 ; TODO: these outputs would need to be done only once after surfacing... |
1722 btfsc deco_region ; been within the deco stops region before? | 1726 btfsc deco_region ; been within the deco stops region before? |
1723 return ; YES - been in deco then before too, done | 1727 return ; YES - been in deco then before too, done |
1724 movff char_O_deco_info,WREG ; NO - get deco info vector | 1728 movff char_O_deco_info,WREG ; NO - get deco info vector |
1725 btfss WREG,deco_stops_norm ; do we have a deco obligation right now? | 1729 btfss WREG,deco_stops_norm ; do we have a deco obligation right now? |
1726 return ; NO - done | 1730 return ; NO - done |
1727 bsf deco_locked ; YES - memorize dive was in deco | 1731 ; bsf deco_locked ; YES - memorize dive was in deco |
1728 movff char_O_deco_depth+0,WREG ; - get depth of first stop in meters into WREG | 1732 movff char_O_deco_depth+0,WREG ; - get depth of first stop in meters into WREG |
1729 addlw deco_region_distance+.1 ; - add deco region start distance + 1 meter for the negative test to work | 1733 addlw deco_region_distance+.1 ; - add deco region start distance + 1 meter for the negative test to work |
1730 subwf depth_meter,W ; - compute current depth - (first stop depth + deco region distance) | 1734 subwf depth_meter,W ; - compute current depth - (first stop depth + deco region distance) |
1731 btfss STATUS,C ; - result negative? | 1735 btfss STATUS,C ; - result negative? |
1732 bsf deco_region ; YES - memorize to have entered the deco stops region | 1736 bsf deco_region ; YES - memorize to have entered the deco stops region |
3376 | 3380 |
3377 clrf apnoe_surface_mins ; clear apnoe surface time, minutes (8 bit) | 3381 clrf apnoe_surface_mins ; clear apnoe surface time, minutes (8 bit) |
3378 clrf apnoe_surface_secs ; clear apnoe surface time, seconds (8 bit) | 3382 clrf apnoe_surface_secs ; clear apnoe surface time, seconds (8 bit) |
3379 clrf apnoe_dive_mins ; clear apnoe dive time, minutes (8 bit) | 3383 clrf apnoe_dive_mins ; clear apnoe dive time, minutes (8 bit) |
3380 clrf apnoe_dive_secs ; clear apnoe dive time, seconds (8 bit) | 3384 clrf apnoe_dive_secs ; clear apnoe dive time, seconds (8 bit) |
3385 clrf apnoe_dive_counter ; clear apnoe #dive counter (8 bit) | |
3381 | 3386 |
3382 return ; done with dive mode boot | 3387 return ; done with dive mode boot |
3383 | 3388 |
3384 | 3389 |
3385 ;============================================================================= | 3390 ;============================================================================= |