Mercurial > public > hwos_code
comparison src/start.asm @ 464:0491a84fd0b8
CHANGE: Easier to understand "New Battery" menu (OSTC model dependent)
author | heinrichsweikamp |
---|---|
date | Wed, 02 Nov 2016 15:46:22 +0100 |
parents | 2c58631d5229 |
children | 4fdf6886004b |
comparison
equal
deleted
inserted
replaced
463:2c58631d5229 | 464:0491a84fd0b8 |
---|---|
139 call deco_calc_wo_deco_step_1_min ; calculate deco in surface mode | 139 call deco_calc_wo_deco_step_1_min ; calculate deco in surface mode |
140 banksel common | 140 banksel common |
141 bcf menubit ; clear menu flag | 141 bcf menubit ; clear menu flag |
142 | 142 |
143 ; Check for Power-on reset here | 143 ; Check for Power-on reset here |
144 extern new_battery_menu,use_old_batteries, use_old_prior_209 | 144 extern use_old_prior_209 |
145 ; ***************************************************************************** | 145 ; ***************************************************************************** |
146 ; "new_battery_menu" and "use_old_batteries" 'goto' back to "power_on_return" | 146 ; "new_battery_menu" and "use_old_batteries" 'goto' back to "power_on_return" |
147 ; ***************************************************************************** | 147 ; ***************************************************************************** |
148 | 148 |
149 ; Try to migrate the old battery status from firmware 2.09 or earlier.. | 149 ; Try to migrate the old battery status from firmware 2.09 or earlier.. |
150 btfsc RCON,POR ; Was this a power-on reset? | 150 btfsc RCON,POR ; Was this a power-on reset? |
151 call use_old_prior_209 | 151 call use_old_prior_209 |
152 | 152 |
153 bcf use_old_batt_flag | |
153 btfsc RCON,POR ; Was this a power-on reset? | 154 btfsc RCON,POR ; Was this a power-on reset? |
154 goto use_old_batteries ; No, load last stored battery values and return to "power_on_return:" | 155 bsf use_old_batt_flag ; No |
155 | 156 |
156 ; bsf LEDg | |
157 goto new_battery_menu ; No, show "New battery dialog" and return to "power_on_return:" | |
158 | |
159 global power_on_return | |
160 power_on_return: | |
161 bsf RCON,POR ; Set bit for next detection | |
162 | |
163 call lt2942_get_status ; Check for gauge IC | 157 call lt2942_get_status ; Check for gauge IC |
164 btfss battery_gauge_available ; cR or 2 hardware? | 158 btfss battery_gauge_available ; cR or 2 hardware? |
165 bra power_on_return2 ; no | 159 bra power_on_return2 ; no |
166 | 160 |
167 movlw .30 | 161 movlw .30 |
353 | 347 |
354 bsf flip_screen ; Flip 180° | 348 bsf flip_screen ; Flip 180° |
355 TSTOSS opt_flip_screen ; =1: Flip the screen | 349 TSTOSS opt_flip_screen ; =1: Flip the screen |
356 bcf flip_screen ; Normal orientation | 350 bcf flip_screen ; Normal orientation |
357 | 351 |
358 goto surfloop ; Jump to Surfaceloop! | 352 btfsc use_old_batt_flag ; =1: load old battery information after power-on reset |
353 goto use_old_batteries ; Returns to "surfloop"! | |
354 | |
355 btfsc RCON,POR ; Was this a power-on reset? | |
356 goto surfloop ; Jump to Surfaceloop! | |
357 bsf RCON,POR ; Set bit for next detection | |
358 ; Things to do after a power-on reset | |
359 extern new_battery_menu,use_old_batteries | |
360 goto new_battery_menu ; Returns to "surfloop"! | |
359 | 361 |
360 ;============================================================================= | 362 ;============================================================================= |
361 ; Setup all flags and parameters for divemode and simulator computations. | 363 ; Setup all flags and parameters for divemode and simulator computations. |
362 ; | 364 ; |
363 global restart_set_modes_and_flags | 365 global restart_set_modes_and_flags |