Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/menu.asm @ 575:cbdcbbc91877
some code cleaning
author | heinrichsweikamp |
---|---|
date | Sat, 21 Apr 2012 15:08:09 +0200 |
parents | 101fec6a6137 |
children | ab2686087bce |
comparison
equal
deleted
inserted
replaced
574:101fec6a6137 | 575:cbdcbbc91877 |
---|---|
55 | 55 |
56 btfss menubit | 56 btfss menubit |
57 goto restart ; exit menu, restart | 57 goto restart ; exit menu, restart |
58 | 58 |
59 btfsc onesecupdate | 59 btfsc onesecupdate |
60 call timeout_surfmode | 60 call menu_check_dive_and_timeout ; "Goto restart" or sets sleepmode flag |
61 | |
62 btfsc onesecupdate | |
63 call set_dive_modes | |
64 | |
65 btfsc onesecupdate | |
66 call test_charger ; check if charger IC is active | |
67 | |
68 btfsc onesecupdate | |
69 call get_battery_voltage ; get battery voltage | |
70 | 61 |
71 bcf onesecupdate ; End of one second tasks | 62 bcf onesecupdate ; End of one second tasks |
72 | 63 |
73 btfsc sleepmode | 64 btfsc sleepmode |
74 goto restart | 65 goto restart |
75 | |
76 btfsc divemode | |
77 goto restart ; exit menu, restart and enter divemode | |
78 | 66 |
79 bra menu_loop | 67 bra menu_loop |
80 | 68 |
81 check_switches_menu: ; checks switches | 69 check_switches_menu: ; checks switches |
82 btfsc uart_dump_screen ; Asked to dump screen contains ? | 70 btfsc uart_dump_screen ; Asked to dump screen contains ? |
153 | 141 |
154 btfss menubit | 142 btfss menubit |
155 bra menu ; exit setup menu and return to main menu | 143 bra menu ; exit setup menu and return to main menu |
156 | 144 |
157 btfsc onesecupdate | 145 btfsc onesecupdate |
158 call timeout_surfmode | 146 call menu_check_dive_and_timeout ; "Goto restart" or sets sleepmode flag |
159 | |
160 btfsc onesecupdate | |
161 call set_dive_modes | |
162 | |
163 btfsc onesecupdate | |
164 call test_charger ; check if charger IC is active | |
165 | |
166 btfsc onesecupdate | |
167 call get_battery_voltage ; get battery voltage | |
168 | 147 |
169 bcf onesecupdate ; End of one second tasks | 148 bcf onesecupdate ; End of one second tasks |
170 | 149 |
171 btfsc sleepmode | 150 btfsc sleepmode |
172 bra menu | 151 bra menu |
173 | |
174 btfsc divemode | |
175 goto restart ; exit menu, restart and enter divemode | |
176 | 152 |
177 bra more_menu_loop | 153 bra more_menu_loop |
178 | 154 |
179 do_more_menu: ; calls submenu | 155 do_more_menu: ; calls submenu |
180 dcfsnz menupos,F | 156 dcfsnz menupos,F |
217 btfsc menubit2 | 193 btfsc menubit2 |
218 bra do_setup_menu ; call submenu | 194 bra do_setup_menu ; call submenu |
219 | 195 |
220 btfss menubit | 196 btfss menubit |
221 goto restart ; exit menu, restart and enter surfmode | 197 goto restart ; exit menu, restart and enter surfmode |
198 | |
222 btfsc onesecupdate | 199 btfsc onesecupdate |
223 call timeout_surfmode | 200 call menu_check_dive_and_timeout ; "Goto restart" or sets sleepmode flag |
224 btfsc onesecupdate | |
225 call set_dive_modes | |
226 btfsc onesecupdate | |
227 call test_charger ; check if charger IC is active | |
228 btfsc onesecupdate | |
229 call get_battery_voltage ; get battery voltage | |
230 | 201 |
231 bcf onesecupdate ; End of one second tasks | 202 bcf onesecupdate ; End of one second tasks |
232 | 203 |
233 btfsc sleepmode | 204 btfsc sleepmode |
234 goto restart ; exit menu, restart and enter surfmode | 205 goto restart ; exit menu, restart and enter surfmode |
235 | |
236 btfsc divemode | |
237 goto restart ; exit menu, restart and enter divemode | |
238 | 206 |
239 bra setup_menu_loop | 207 bra setup_menu_loop |
240 | 208 |
241 | 209 |
242 do_setup_menu: ; calls submenu | 210 do_setup_menu: ; calls submenu |
376 | 344 |
377 btfss menubit | 345 btfss menubit |
378 goto restart ; exit menu, restart and enter surfmode | 346 goto restart ; exit menu, restart and enter surfmode |
379 | 347 |
380 btfsc onesecupdate | 348 btfsc onesecupdate |
381 call timeout_surfmode | 349 call menu_check_dive_and_timeout ; "Goto restart" or sets sleepmode flag |
382 btfsc onesecupdate | |
383 call set_dive_modes | |
384 btfsc onesecupdate | |
385 call test_charger ; check if charger IC is active | |
386 btfsc onesecupdate | |
387 call get_battery_voltage ; get battery voltage | |
388 | 350 |
389 bcf onesecupdate ; End of one second tasks | 351 bcf onesecupdate ; End of one second tasks |
390 | 352 |
391 btfsc sleepmode | 353 btfsc sleepmode |
392 goto setup_menu ; exit menu | 354 goto setup_menu ; exit menu |
393 | |
394 btfsc divemode | |
395 goto restart ; exit menu, restart and enter divemode | |
396 | 355 |
397 bra more_setup_menu_loop | 356 bra more_setup_menu_loop |
398 | 357 |
399 do_more_setup_menu: ; calls submenu | 358 do_more_setup_menu: ; calls submenu |
400 dcfsnz menupos,F | 359 dcfsnz menupos,F |
574 decf EEDATA,F | 533 decf EEDATA,F |
575 tstfsz EEDATA | 534 tstfsz EEDATA |
576 bra show_decotype3 | 535 bra show_decotype3 |
577 DISPLAYTEXT .130 ; ON | 536 DISPLAYTEXT .130 ; ON |
578 return | 537 return |
538 | |
539 menu_check_dive_and_timeout: | |
540 call set_dive_modes ; Check thresholds | |
541 call timeout_surfmode ; Sets sleepmode flag if timeout | |
542 btfsc divemode | |
543 goto restart ; dive started! | |
544 return |