Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 617:8d1ff6fc54f5
update divetime at begin of new second
author | heinrichsweikamp |
---|---|
date | Sat, 21 Jul 2012 11:55:54 +0200 |
parents | 3ab53b57f879 |
children | f87205426add |
comparison
equal
deleted
inserted
replaced
616:ee5a9c0d09fb | 617:8d1ff6fc54f5 |
---|---|
59 | 59 |
60 btfsc gauge_mode ; Only in gauge mode | 60 btfsc gauge_mode ; Only in gauge mode |
61 bra diveloop_loop1a ; One Second Tasks in Gauge mode | 61 bra diveloop_loop1a ; One Second Tasks in Gauge mode |
62 btfsc FLAG_apnoe_mode ; Only in apnoe mode | 62 btfsc FLAG_apnoe_mode ; Only in apnoe mode |
63 bra diveloop_loop1b ; One Second Tasks in Apnoe mode | 63 bra diveloop_loop1b ; One Second Tasks in Apnoe mode |
64 btfsc FLAG_const_ppO2_mode ; only in const_ppO2_mode | 64 |
65 bra diveloop_loop1c ; One Second Tasks in const_ppO2 mode | 65 ; Update divetime |
66 | |
67 ; Tasks only for OC modes | |
68 btfsc show_safety_stop ; Show the safety stop? | |
69 call PLED_show_safety_stop ; Yes, show/delete if done. | |
70 call check_ppO2 ; check ppO2 and displays warning if required | |
71 call calc_deko_divemode ; calculate decompression and display result (any two seconds) | |
72 bra diveloop_loop1x ; Common Tasks | |
73 | |
74 ; Tasks only for Gauge mode | |
75 diveloop_loop1a: | |
76 btfss premenu ; Is the divemode menu active? | |
77 call PLED_divemins ; display (new) divetime! | |
78 call timeout_divemode ; dive finished? This routine sets the required flags | |
79 | |
80 btfsc twosecupdate ; two seconds after the last call | |
81 bra diveloop_loop1a2 ; Common Tasks | |
82 | |
83 bsf twosecupdate ; Routines used in the "other second" | |
84 call calc_average_depth ; calculate average depth | |
85 call calc_velocity ; calculate vertical velocity and display if > threshold (every two seconds) | |
86 | |
87 bra diveloop_loop1x ; Common Tasks | |
88 | |
89 diveloop_loop1a2: | |
90 bcf twosecupdate | |
91 bra diveloop_loop1x ; Common Tasks | |
92 | |
93 ; Tasks only for Apnoe mode | |
94 diveloop_loop1b: | |
95 call divemode_apnoe_tasks ; 1 sec. Apnoe tasks | |
96 bra diveloop_loop1x ; Common Tasks | |
97 | |
98 ; Tasks only for ppO2 mode | |
99 diveloop_loop1c: | |
100 btfsc show_safety_stop ; Show the safety stop? | |
101 call PLED_show_safety_stop ; Yes, show/delete if done. | |
102 call PLED_const_ppO2_value ; display const ppO2 setting in [bar] | |
103 call calc_deko_divemode ; calculate decompression and display result (any two seconds) | |
104 btfsc is_bailout ; Are we in Bailout mode? | |
105 call check_ppO2_bail ; Yes, display ppO2 (If required) | |
106 | |
107 bra diveloop_loop1x ; Common Tasks | |
108 | |
109 ; Common Tasks for all modes | |
110 diveloop_loop1x: | |
111 call customview_second ; Do every-second tasks for the custom view area | 66 call customview_second ; Do every-second tasks for the custom view area |
112 | |
113 GETCUSTOM8 d'38' ; Show seconds (=1?) | 67 GETCUSTOM8 d'38' ; Show seconds (=1?) |
114 movwf lo | 68 movwf lo |
115 movlw d'1' | 69 movlw d'1' |
116 cpfseq lo ; =1? | 70 cpfseq lo ; =1? |
117 bra diveloop_loop1y ; No, minutes only | 71 bra diveloop_loop1y ; No, minutes only |
120 btfss update_divetime ; display new divetime? | 74 btfss update_divetime ; display new divetime? |
121 bra diveloop_loop1z ; No | 75 bra diveloop_loop1z ; No |
122 btfsc premenu ; Is the divemode menu active? | 76 btfsc premenu ; Is the divemode menu active? |
123 bra diveloop_loop1z ; Yes | 77 bra diveloop_loop1z ; Yes |
124 call PLED_divemins ; Display (new) divetime! | 78 call PLED_divemins ; Display (new) divetime! |
125 | 79 diveloop_loop1z: |
126 diveloop_loop1z | |
127 bcf update_divetime ; clear flag | 80 bcf update_divetime ; clear flag |
128 | 81 |
129 ; btfsc FLAG_const_ppO2_mode ; only in const_ppO2_mode | 82 btfsc FLAG_const_ppO2_mode ; only in const_ppO2_mode |
130 ; call PLED_const_ppO2_value ; display const ppO2 setting in [bar] | 83 bra diveloop_loop1c ; One Second Tasks in const_ppO2 mode |
131 btfsc ppO2_show_value ; show ppO2? | 84 |
132 call check_ppO2 ; check ppO2 and displays warning if required | 85 ; Tasks only for OC modes |
133 | 86 btfsc show_safety_stop ; Show the safety stop? |
87 call PLED_show_safety_stop ; Yes, show/delete if done. | |
88 call check_ppO2 ; check ppO2 and displays warning if required | |
89 call calc_deko_divemode ; calculate decompression and display result (any two seconds) | |
90 bra diveloop_loop1x ; Common Tasks | |
91 | |
92 ; Tasks only for Gauge mode | |
93 diveloop_loop1a: | |
94 btfss premenu ; Is the divemode menu active? | |
95 call PLED_divemins ; display (new) divetime! | |
96 call timeout_divemode ; dive finished? This routine sets the required flags | |
97 | |
98 btfsc twosecupdate ; two seconds after the last call | |
99 bra diveloop_loop1a2 ; Common Tasks | |
100 | |
101 bsf twosecupdate ; Routines used in the "other second" | |
102 call calc_average_depth ; calculate average depth | |
103 call calc_velocity ; calculate vertical velocity and display if > threshold (every two seconds) | |
104 | |
105 bra diveloop_loop1x ; Common Tasks | |
106 | |
107 diveloop_loop1a2: | |
108 bcf twosecupdate | |
109 bra diveloop_loop1x ; Common Tasks | |
110 | |
111 ; Tasks only for Apnoe mode | |
112 diveloop_loop1b: | |
113 call divemode_apnoe_tasks ; 1 sec. Apnoe tasks | |
114 bra diveloop_loop1x ; Common Tasks | |
115 | |
116 ; Tasks only for ppO2 mode | |
117 diveloop_loop1c: | |
118 btfsc show_safety_stop ; Show the safety stop? | |
119 call PLED_show_safety_stop ; Yes, show/delete if done. | |
120 call PLED_const_ppO2_value ; display const ppO2 setting in [bar] | |
121 call calc_deko_divemode ; calculate decompression and display result (any two seconds) | |
122 btfsc is_bailout ; Are we in Bailout mode? | |
123 call check_ppO2_bail ; Yes, display ppO2 (If required) | |
124 | |
125 bra diveloop_loop1x ; Common Tasks | |
126 | |
127 ; Common Tasks for all modes | |
128 diveloop_loop1x: | |
129 ; call customview_second ; Do every-second tasks for the custom view area | |
130 ; | |
131 ; GETCUSTOM8 d'38' ; Show seconds (=1?) | |
132 ; movwf lo | |
133 ; movlw d'1' | |
134 ; cpfseq lo ; =1? | |
135 ; bra diveloop_loop1y ; No, minutes only | |
136 ; bsf update_divetime ; Set Update flag | |
137 ;diveloop_loop1y: | |
138 ; btfss update_divetime ; display new divetime? | |
139 ; bra diveloop_loop1z ; No | |
140 ; btfsc premenu ; Is the divemode menu active? | |
141 ; bra diveloop_loop1z ; Yes | |
142 ; call PLED_divemins ; Display (new) divetime! | |
143 ; | |
144 ;diveloop_loop1z: | |
145 ; bcf update_divetime ; clear flag | |
146 | |
147 btfsc ppO2_show_value ; show ppO2? | |
148 call check_ppO2 ; check ppO2 and displays warning if required | |
134 call timeout_divemode ; dive finished? This routine sets the required flags | 149 call timeout_divemode ; dive finished? This routine sets the required flags |
135 btfsc low_battery_state ; If battery is low, then... | 150 btfsc low_battery_state ; If battery is low, then... |
136 call update_batt_voltage_divemode ; Display Battery Warning Text | 151 call update_batt_voltage_divemode ; Display Battery Warning Text |
137 btfsc premenu ; is Menu? displayed? | 152 btfsc premenu ; is Menu? displayed? |
138 call timeout_premenu_divemode ; No, so check for timeout premenu | 153 call timeout_premenu_divemode ; No, so check for timeout premenu |
139 btfsc menubit ; is the Dive mode menu displayed? | 154 btfsc menubit ; is the Dive mode menu displayed? |
140 call timeout_divemenu ; Yes, so check for timeout divemenu | 155 call timeout_divemenu ; Yes, so check for timeout divemenu |
141 call set_leds_divemode ; Sets warnings, if required. Also Sets buzzer | 156 call set_leds_divemode ; Sets warnings, if required. Also Sets buzzer |
142 btfsc enter_error_sleep ; Enter Fatal Error Routine? | 157 btfsc enter_error_sleep ; Enter Fatal Error Routine? |
143 call fatal_error_sleep ; Yes (In Sleepmode_vxx.asm!) | 158 call fatal_error_sleep ; Yes (In Sleepmode.asm!) |
144 | |
145 | 159 |
146 bcf onesecupdate ; one seconds update done | 160 bcf onesecupdate ; one seconds update done |
147 | 161 |
148 diveloop_loop3: | 162 diveloop_loop3: |
149 btfss menubit ; Divemode menu active? | 163 btfss menubit ; Divemode menu active? |