Mercurial > public > hwos_code
comparison src/divemode.asm @ 254:5fe7aff622f3
preparations to set a course for the compass display
author | heinrichsweikamp |
---|---|
date | Fri, 20 Mar 2015 10:16:49 +0100 |
parents | 6c4ad243cb44 |
children | ad62dff7739a |
comparison
equal
deleted
inserted
replaced
253:b0fbb212ecb7 | 254:5fe7aff622f3 |
---|---|
82 | 82 |
83 diveloop_loop1b: | 83 diveloop_loop1b: |
84 ; Tasks only for Apnoe mode | 84 ; Tasks only for Apnoe mode |
85 rcall divemode_apnoe_tasks ; 1 sec. Apnoe tasks | 85 rcall divemode_apnoe_tasks ; 1 sec. Apnoe tasks |
86 call customview_second ; Do every-second tasks for the custom view area | 86 call customview_second ; Do every-second tasks for the custom view area |
87 ; call divemode_check_for_warnings ; Check for any warnings | 87 bra diveloop_loop1x ; Common Tasks |
88 bra diveloop_loop1x ; Common Tasks | |
89 | 88 |
90 diveloop_loop1x: | 89 diveloop_loop1x: |
91 ; Common 1sec. tasks for all modes | 90 ; Common 1sec. tasks for all modes |
92 rcall timeout_divemode ; dive finished? This routine sets the required flags | 91 rcall timeout_divemode ; dive finished? This routine sets the required flags |
93 rcall set_dive_modes ; tests if depth>threshold | 92 rcall set_dive_modes ; tests if depth>threshold |
881 bra divemode_option4 ; Quit Apnoe mode | 880 bra divemode_option4 ; Quit Apnoe mode |
882 dcfsnz WREG,F | 881 dcfsnz WREG,F |
883 bra divemode_option5 ; Reset Stopwatch (In Gauge mode) | 882 bra divemode_option5 ; Reset Stopwatch (In Gauge mode) |
884 dcfsnz WREG,F | 883 dcfsnz WREG,F |
885 bra divemode_option6 ; +5mins simulation | 884 bra divemode_option6 ; +5mins simulation |
885 dcfsnz WREG,F | |
886 bra divemode_option7 ; Store heading | |
886 return | 887 return |
887 | 888 |
888 test_switches_divemode2: | 889 test_switches_divemode2: |
889 bcf switch_left | |
890 call menuview_toggle ; Menu or Simulator tasks | 890 call menuview_toggle ; Menu or Simulator tasks |
891 return | 891 return |
892 | 892 |
893 gas_switched_common: | 893 gas_switched_common: |
894 bcf divemode_gaschange ; Clear flag | 894 bcf divemode_gaschange ; Clear flag |
1027 divemode_option6: | 1027 divemode_option6: |
1028 bcf divemode2 ; Stop divetime | 1028 bcf divemode2 ; Stop divetime |
1029 movlw .5 | 1029 movlw .5 |
1030 addwf divemins+0,F | 1030 addwf divemins+0,F |
1031 movlw .0 | 1031 movlw .0 |
1032 addwfc divemins+1,F | 1032 addwfc divemins+1,F ; Add 5 mins |
1033 movlw .5 | 1033 movlw .5 |
1034 movwf up | 1034 movwf up ; counter |
1035 ; 1min mode | 1035 ; 1min mode |
1036 divemode_option6_2: | 1036 divemode_option6_2: |
1037 movlw .1 | 1037 movlw .1 |
1038 movff WREG,char_I_step_is_1min ; Force 1min mode | 1038 movff WREG,char_I_step_is_1min ; Force 1min mode |
1039 clrf TMR5L | 1039 clrf TMR5L |
1044 bra divemode_option6_2 ; Not yet | 1044 bra divemode_option6_2 ; Not yet |
1045 bsf divemode2 ; continue divetime | 1045 bsf divemode2 ; continue divetime |
1046 call menuview_toggle_reset | 1046 call menuview_toggle_reset |
1047 return | 1047 return |
1048 | 1048 |
1049 ; 2sec mode | 1049 divemode_option7: |
1050 ; #DEFINE divemode_simtext_row .164 | 1050 ; Store heading for compass view |
1051 ; #DEFINE divemode_simtext_column .32 | 1051 call menuview_toggle_reset ; Done. |
1052 ; | |
1053 ; rcall divemode_option6_divetime | |
1054 ; rcall divemode_option6_divetime ; 2 times | |
1055 ; | |
1056 ; bsf win_invert ; Set invert flag | |
1057 ; movlw color_yellow | |
1058 ; call TFT_set_color | |
1059 ; bsf leftbind | |
1060 ; WIN_SMALL divemode_simtext_column,divemode_simtext_row | |
1061 ; lfsr FSR2,buffer | |
1062 ; movlw .2 | |
1063 ; mulwf up | |
1064 ; movff PRODL,lo | |
1065 ; movff PRODH,hi | |
1066 ; output_16 | |
1067 ; STRCAT_PRINT "s " ; Show 300s delay countdown | |
1068 ; call TFT_standard_color | |
1069 ; bcf win_invert | |
1070 ; bcf leftbind | |
1071 ; rcall calc_deko_divemode2a ; Calc 150*2 seconds = 300secs = 5mins | |
1072 ; decfsz up,F ; Done? | |
1073 ; bra divemode_option6_2 ; Not yet | |
1074 ; bsf divemode2 ; continue divetime | |
1075 ; call menuview_toggle_reset | |
1076 ; return | |
1077 | |
1078 divemode_option6_divetime: | |
1079 incf divesecs,F | |
1080 movlw d'59' | |
1081 cpfsgt divesecs | |
1082 bra divemode_option6_divetime2 | |
1083 clrf divesecs | |
1084 infsnz divemins+0,F | |
1085 incf divemins+1,F ; increase divemins | |
1086 divemode_option6_divetime2: | |
1087 return | 1052 return |
1088 | 1053 |
1089 | 1054 |
1090 divemode_simulator_check_limits: | 1055 divemode_simulator_check_limits: |
1091 ; Check limits (150m and 0m) | 1056 ; Check limits (150m and 0m) |