Mercurial > public > hwos_code
annotate src/menu_tree.asm @ 21:79b2084fd75a
Reset options to default if they are not within the allowed min/max values
author | heinrichsweikamp |
---|---|
date | Thu, 04 Jul 2013 09:51:33 +0200 |
parents | 4e3f133dfbf4 |
children | e402813343b6 |
rev | line source |
---|---|
0 | 1 ;============================================================================= |
2 ; | |
3 ; File menu_tree.asm | |
4 ; | |
5 ; OSTC3 menus | |
6 ; | |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | |
8 ;============================================================================= | |
9 ; HISTORY | |
10 ; 2011-07-11 : [jDG] Creation. | |
11 | |
12 #include "ostc3.inc" ; Mandatory header | |
13 #include "gaslist.inc" | |
14 #include "menu_processor.inc" | |
15 #include "start.inc" | |
16 #include "comm.inc" | |
17 #include "logbook.inc" | |
18 #include "tft.inc" | |
19 #include "eeprom_rs232.inc" | |
20 #include "external_flash.inc" | |
21 #include "shared_definitions.h" ; Mailbox from/to p2_deco.c | |
22 #include "isr.inc" | |
23 #include "ghostwriter.inc" | |
24 #include "adc_lightsensor.inc" | |
25 | |
26 gui CODE | |
27 ;============================================================================= | |
28 ; Main Menu | |
29 global do_main_menu | |
30 do_main_menu: | |
31 bcf sleepmode ; for timeout | |
32 call menu_processor_reset ; restart from first icon. | |
33 | |
34 do_continue_main_menu: | |
35 call menu_processor_pop ; drop exit line. | |
36 call menu_processor_pop ; back to last icon. | |
37 | |
38 extern do_demo_divemode, restart | |
39 MENU_BEGIN tMainMenu, .7 | |
40 MENU_CALL tLogbook, logbook | |
41 MENU_CALL tGasSetup, do_gas_menu | |
42 MENU_CALL tCCRSetup, do_ccr_menu | |
43 MENU_CALL tPlan, do_planner_menu_reset | |
44 MENU_CALL tDiveModeMenu, do_divemode_menu | |
45 MENU_CALL tSystSets, do_settings_menu | |
46 MENU_CALL tExit, restart | |
47 MENU_END | |
48 | |
49 do_info_menu: | |
50 MENU_BEGIN tInfoMenu, .4 | |
51 MENU_DYNAMIC info_menu_serial, 0 | |
52 MENU_DYNAMIC info_menu_firmware, 0 | |
53 MENU_DYNAMIC info_menu_total_dives, 0 | |
54 MENU_CALL tExit, do_return_settings | |
55 MENU_END | |
56 | |
57 ;============================================================================= | |
58 ; CCR Setup | |
59 | |
60 return_ccr_menu: | |
61 call menu_processor_pop ; drop exit line. | |
62 call menu_processor_pop ; back to last gas. | |
63 | |
64 do_ccr_menu: | |
65 bcf menu_show_sensors ; Set flag | |
66 MENU_BEGIN tCCRSetup, .5 | |
67 MENU_OPTION tCCRMode, oCCRMode, 0 | |
68 MENU_CALL tCCRSensor, do_ccr_sensor | |
69 MENU_CALL tDiluentSetup, do_diluent_setup | |
70 MENU_CALL tFixedSetpoints, do_fixed_setpoints | |
71 MENU_CALL tExit, do_continue_main_menu | |
72 MENU_END | |
73 | |
74 do_ccr_sensor: | |
75 call enable_ir ; Enable IR-Port | |
76 bsf menu_show_sensors ; Set flag | |
77 MENU_BEGIN tCCRSensor, .4 | |
78 MENU_CALL tDiveHudMask1, 0 | |
79 MENU_CALL tDiveHudMask2, 0 | |
80 MENU_CALL tDiveHudMask3, 0 | |
81 MENU_CALL tExit, return_ccr_menu | |
82 MENU_END | |
83 | |
84 do_diluent_setup: | |
85 bsf ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10") | |
86 call gaslist_cleanup_list ; Takes care that only one gas can be first and first has 0m change depth | |
87 MENU_BEGIN tDiluentSetup, .6 | |
88 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
89 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
90 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
91 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
92 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
93 MENU_CALL tExit, return_ccr_menu | |
94 MENU_END | |
95 | |
96 do_return_fixed_setpoints: | |
97 call menu_processor_pop ; drop exit line. | |
98 call menu_processor_pop ; back to last gas. | |
99 | |
100 do_fixed_setpoints: | |
101 MENU_BEGIN tFixedSetpoints, .6 | |
102 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu | |
103 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu | |
104 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu | |
105 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu | |
106 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu | |
107 MENU_CALL tExit, return_ccr_menu | |
108 MENU_END | |
109 | |
110 do_edit_sp_menu: | |
111 call gaslist_setSP ; Save current item. | |
112 MENU_BEGIN tFixedSetpoints, .5 | |
113 MENU_DYNAMIC gaslist_strcat_setpoint_0,0 | |
114 MENU_CALL tSPPlus, gaslist_spplus | |
115 MENU_CALL tDepthPlus, gaslist_spdepthplus | |
116 MENU_CALL tDepthMinus, gaslist_spdepthminus | |
117 MENU_CALL tExit, do_return_fixed_setpoints | |
118 MENU_END | |
119 | |
120 ;============================================================================= | |
121 ; OC Gas Setup | |
122 | |
123 return_gas_menu: | |
124 call menu_processor_pop ; drop exit line. | |
125 call menu_processor_pop ; back to last gas. | |
126 | |
127 btfsc ccr_diluent_setup ; Return to CCR-Menu? | |
128 bra do_diluent_setup ; Yes. | |
129 do_gas_menu: | |
130 bcf ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10") | |
131 call gaslist_cleanup_list ; Takes care that only one gas can be first and first has 0m change depth | |
132 MENU_BEGIN tGaslist, .6 | |
133 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
134 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
135 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
136 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
137 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
138 MENU_CALL tExit, do_continue_main_menu | |
139 MENU_END | |
140 | |
141 return_gas_depth: | |
142 call menu_processor_pop ; drop exit line. | |
143 call menu_processor_pop ; back to last gas. | |
144 bra do_edit_gas_menu_1 | |
145 | |
146 do_edit_gas_menu: | |
147 call gaslist_setgas ; Save current item. | |
148 do_edit_gas_menu_1: ; Keep current gas. | |
149 MENU_BEGIN tGasEdit, .6 | |
150 MENU_DYNAMIC gaslist_gastitle, 0 | |
151 MENU_DYNAMIC gaslist_MOD_END, 0 | |
152 MENU_DYNAMIC gaslist_show_type, gaslist_toggle_type | |
153 MENU_CALL tSetup_mix, do_setup_mix | |
154 MENU_CALL tGasDepth, do_gas_depth_menu | |
155 MENU_CALL tExit, return_gas_menu | |
156 MENU_END | |
157 | |
158 do_setup_mix: | |
159 MENU_BEGIN tGasEdit, .7 | |
160 MENU_DYNAMIC gaslist_gastitle, 0 | |
161 MENU_DYNAMIC gaslist_MOD_END, 0 | |
162 MENU_CALL tO2Plus, gaslist_pO2 | |
163 MENU_CALL tO2Minus, gaslist_mO2 | |
164 MENU_CALL tHePlus, gaslist_pHe | |
165 MENU_CALL tHeMinus, gaslist_mHe | |
166 MENU_CALL tExit, return_gas_depth | |
167 MENU_END | |
168 | |
169 global do_gas_depth_menu | |
170 do_gas_depth_menu: | |
171 MENU_BEGIN tGasEdit, .6 | |
172 MENU_DYNAMIC gaslist_gastitle, 0 | |
173 MENU_DYNAMIC gaslist_MOD_END, 0 | |
174 MENU_CALL tDepthPlus, gaslist_pDepth | |
175 MENU_CALL tDepthMinus, gaslist_mDepth | |
176 MENU_DYNAMIC gaslist_reset_mod_title,gaslist_reset_mod | |
177 MENU_CALL tExit, return_gas_depth | |
178 MENU_END | |
179 | |
180 ;============================================================================= | |
181 ; Simulator menus | |
182 | |
183 global do_planner_menu | |
184 | |
185 do_planner_menu_reset: | |
186 extern option_save_all | |
187 call option_save_all | |
188 ;---- Reset dive time/depth to default values | |
189 extern option_reset | |
190 lfsr FSR0,odiveInterval | |
191 call option_reset | |
192 lfsr FSR0,obottomTime | |
193 call option_reset | |
194 lfsr FSR0,obottomDepth | |
195 call option_reset | |
196 | |
197 do_planner_menu: | |
198 extern do_demo_planner | |
199 MENU_BEGIN tPlan, .6 | |
200 MENU_CALL tInter, do_demo_divemode | |
201 MENU_OPTION tIntvl, odiveInterval, 0 | |
202 MENU_OPTION tBtTm, obottomTime, 0 | |
203 MENU_OPTION tMxDep, obottomDepth, 0 | |
204 MENU_CALL tDeco, do_demo_planner | |
205 MENU_CALL tExit, do_continue_main_menu | |
206 MENU_END | |
207 | |
208 ;============================================================================= | |
209 ; Divemode menu | |
210 | |
211 do_return_divemode_menu: | |
212 call menu_processor_pop ; drop exit line. | |
213 call menu_processor_pop ; back to last gas. | |
214 | |
215 do_divemode_menu: | |
216 MENU_BEGIN tDiveModeMenu, .7 | |
217 MENU_OPTION tDvMode, oDiveMode, 0 | |
218 MENU_OPTION tDkMode, oDecoMode, 0 | |
219 MENU_DYNAMIC divesets_ppo2_max, do_toggle_ppo2_max | |
220 MENU_DYNAMIC divesets_ppo2_min, do_toggle_ppo2_min | |
221 MENU_OPTION tFTTSMenu, oExtraTime,0 | |
222 MENU_CALL tDecoparameters, do_decoparameters_menu | |
223 MENU_CALL tExit, do_continue_main_menu | |
224 MENU_END | |
225 | |
226 do_return_decoparameters_menu: | |
227 call menu_processor_pop ; drop exit line. | |
228 call menu_processor_pop ; back to setting | |
229 do_decoparameters_menu: | |
230 MENU_BEGIN tDecoparameters, .7 | |
231 MENU_OPTION tGF_low, oGF_low, 0 | |
232 MENU_OPTION tGF_high, oGF_high, 0 | |
233 MENU_CALL taGFMenu, do_aGF_menu | |
234 MENU_OPTION tSaturationMult,osatmult, 0 | |
235 MENU_OPTION tDesaturationMult,odesatmult,0 | |
236 MENU_OPTION tLastDecostop,oLastDeco, 0 | |
237 MENU_CALL tExit, do_return_divemode_menu | |
238 MENU_END | |
239 | |
240 do_aGF_menu: | |
241 MENU_BEGIN taGFMenu, .4 | |
242 MENU_OPTION taGF_enable,oEnable_aGF, 0 | |
243 MENU_OPTION taGF_low, oaGF_low, 0 | |
244 MENU_OPTION taGF_high, oaGF_high, 0 | |
245 MENU_CALL tExit, do_return_decoparameters_menu | |
246 MENU_END | |
247 ;============================================================================= | |
248 ; Setup Menu | |
249 | |
250 do_return_settings: | |
251 bcf settime_setdate ; Clear flag | |
252 call menu_processor_pop ; Drop exit entry | |
253 call menu_processor_pop ; Pop return line. | |
254 | |
255 extern compass_calibration_loop | |
256 do_settings_menu: | |
257 MENU_BEGIN tSystSets, .7 | |
258 MENU_CALL tInfoMenu, do_info_menu | |
259 MENU_CALL tSetTimeDate, do_date_time_menu | |
260 MENU_CALL tDispSets, do_dispsets_menu | |
261 MENU_OPTION tLanguage, oLanguage, 0 | |
18
4e3f133dfbf4
add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents:
0
diff
changeset
|
262 MENU_CALL tCompassMenu, do_compass_menu |
0 | 263 MENU_CALL tResetMenu, do_reset_menu |
264 MENU_CALL tExit, do_continue_main_menu | |
265 MENU_END | |
266 | |
18
4e3f133dfbf4
add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents:
0
diff
changeset
|
267 do_compass_menu: |
4e3f133dfbf4
add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents:
0
diff
changeset
|
268 MENU_BEGIN tSystSets, .3 |
4e3f133dfbf4
add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents:
0
diff
changeset
|
269 MENU_CALL tCompassMenu, compass_calibration_loop |
4e3f133dfbf4
add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents:
0
diff
changeset
|
270 MENU_OPTION tCompassGain, oCompassGain, 0 |
4e3f133dfbf4
add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents:
0
diff
changeset
|
271 MENU_CALL tExit, do_return_settings |
4e3f133dfbf4
add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents:
0
diff
changeset
|
272 MENU_END |
4e3f133dfbf4
add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents:
0
diff
changeset
|
273 |
0 | 274 ;============================================================================= |
275 ; Reset and confirmation menu. | |
276 | |
277 do_reset_menu: | |
278 MENU_BEGIN tResetMenu, .5 | |
279 MENU_CALL tExit, do_return_settings | |
280 MENU_CALL tReboot, do_reset_menu2 ; Confirm | |
281 MENU_CALL tResetDeco, do_reset_menu3 ; Confirm | |
282 MENU_CALL tResetSettings, do_reset_menu4 ; Confirm | |
283 MENU_CALL tResetBattery, new_battery_menu ; New Battery submenu | |
284 MENU_END | |
285 | |
286 do_reset_menu2: | |
287 MENU_BEGIN tResetMenu2, .2 | |
288 MENU_CALL tAbort, do_continue_menu_3stack | |
289 MENU_CALL tReboot, do_reboot ; Reboot | |
290 MENU_END | |
291 | |
292 do_reset_menu3: | |
293 MENU_BEGIN tResetMenu2, .2 | |
294 MENU_CALL tAbort, do_continue_menu_3stack | |
295 MENU_CALL tResetDeco, do_reset_deco ; Reset Deco | |
296 MENU_END | |
297 | |
298 do_reset_menu4: | |
299 MENU_BEGIN tResetMenu2, .2 | |
300 MENU_CALL tAbort, do_continue_menu_3stack | |
301 MENU_CALL tResetSettings, do_reset_settings ; Reset all settings | |
302 MENU_END | |
303 | |
304 | |
305 do_reset_deco: | |
306 movlw d'79' ; 79% N2 | |
307 movff WREG,char_I_N2_ratio | |
308 movlw d'0' | |
309 movff WREG,char_I_step_is_1min ; 2 second deco mode | |
310 SAFE_2BYTE_COPY amb_pressure,int_I_pres_respiration ; copy for deco routine | |
311 movff int_I_pres_respiration+0,int_I_pres_surface+0 ; copy for desat routine | |
312 movff int_I_pres_respiration+1,int_I_pres_surface+1 | |
313 | |
314 extern deco_reset | |
315 call deco_reset | |
316 call deco_calc_desaturation_time ; calculate desaturation time | |
317 banksel common | |
318 call deco_calc_wo_deco_step_1_min ; calculate deco in surface mode | |
319 banksel common | |
320 clrf nofly_time+0 ; Reset NoFly | |
321 clrf nofly_time+1 | |
322 clrf desaturation_time+0 ; Reset Desat | |
323 clrf desaturation_time+1 | |
324 goto do_return_settings ; back to menu | |
325 | |
326 do_reset_settings: | |
327 extern option_reset_all | |
328 call option_reset_all ; Reset all options to factory default. | |
329 goto do_continue_main_menu ; back to menu | |
330 | |
331 do_continue_menu_3stack: ; Return three levels deep | |
332 call menu_processor_pop | |
333 goto do_return_settings | |
334 | |
335 do_reboot: | |
336 call ext_flash_enable_protection ; Enables write protection | |
337 reset | |
338 | |
339 | |
340 do_date_time_menu: | |
341 MENU_BEGIN tSetTimeDate, .4 | |
342 MENU_CALL tSetTime, do_time_menu | |
343 MENU_CALL tSetDate, do_date_menu | |
344 MENU_OPTION tDateFormat,oDateFormat, 0 | |
345 MENU_CALL tExit, do_return_settings | |
346 MENU_END | |
347 | |
348 do_date_menu: | |
349 bsf settime_setdate | |
350 MENU_BEGIN tSetDate, .4 | |
351 MENU_OPTION tSetDay, oSetDay, 0 | |
352 MENU_OPTION tSetMonth, oSetMonth, 0 | |
353 MENU_OPTION tSetYear, oSetYear, 0 | |
354 MENU_CALL tExit, do_continue_menu_3stack | |
355 MENU_END | |
356 | |
357 | |
358 do_reset_seconds: | |
359 clrf secs | |
360 extern rtc_set_rtc | |
361 call rtc_set_rtc ; writes mins,sec,hours,day,month and year to rtc module | |
362 do_time_menu: | |
363 bsf settime_setdate | |
364 MENU_BEGIN tSetTime, .4 | |
365 MENU_OPTION tSetHours, oSetHours, 0 | |
366 MENU_OPTION tSetMinutes,oSetMinutes, 0 | |
367 MENU_CALL tSetSeconds, do_reset_seconds | |
368 MENU_CALL tExit, do_continue_menu_3stack | |
369 MENU_END | |
370 | |
371 | |
372 do_toggle_ppo2_max: ; add 0.1bar, with hard-coded max. | |
373 movff opt_ppO2_max,lo ; banksafe | |
374 movlw .10 | |
375 addwf lo,F | |
376 movlw ppo2_highest_setting | |
377 cpfsgt lo | |
378 bra do_toggle_ppo2_max2 | |
379 movlw .120 | |
380 movwf lo | |
381 do_toggle_ppo2_max2: | |
382 movff lo,opt_ppO2_max | |
383 return | |
384 | |
385 do_toggle_ppo2_min: ; sub 0.1bar, with hard-coded min. | |
386 movff opt_ppO2_min,lo ; banksafe | |
387 incf lo,F | |
388 movlw .21 | |
389 cpfsgt lo | |
390 bra do_toggle_ppo2_min2 | |
391 movlw ppo2_lowest_setting | |
392 movwf lo | |
393 do_toggle_ppo2_min2: | |
394 movff lo,opt_ppO2_min | |
395 return | |
396 | |
397 | |
398 ; Logbook offset sub-menu | |
399 do_log_offset_menu: | |
400 MENU_BEGIN tLogOffset, .6 | |
401 MENU_DYNAMIC TFT_LogOffset_Logtitle, 0 | |
402 MENU_CALL tLogOffsetp1, do_logoffset_plus1 | |
403 MENU_CALL tLogOffsetp10, do_logoffset_plus10 | |
404 MENU_CALL tLogOffsetm1, do_logoffset_minus1 | |
405 MENU_CALL tLogOffsetm10, do_logoffset_minus10 | |
406 MENU_CALL tExit, do_dispsets_menu_3stack | |
407 MENU_END | |
408 | |
409 | |
410 do_logoffset_minus1: | |
411 call do_logoffset_common_read ; Read into lo:hi | |
412 movlw d'1' | |
413 subwf lo | |
414 movlw d'0' | |
415 subwfb hi | |
416 btfss hi,7 ; <0? | |
417 goto do_logoffset_common_write ; Store and return | |
418 clrf lo | |
419 clrf hi | |
420 goto do_logoffset_common_write ; Store and return | |
421 | |
422 do_logoffset_minus10: | |
423 call do_logoffset_common_read ; Read into lo:hi | |
424 movlw d'10' | |
425 subwf lo | |
426 movlw d'0' | |
427 subwfb hi | |
428 btfss hi,7 ; <0? | |
429 goto do_logoffset_common_write ; Store and return | |
430 clrf lo | |
431 clrf hi | |
432 goto do_logoffset_common_write ; Store and return | |
433 | |
434 do_logoffset_plus1: | |
435 call do_logoffset_common_read ; Read into lo:hi | |
436 movlw d'1' | |
437 addwf lo | |
438 movlw d'0' | |
439 addwfc hi | |
440 goto do_logoffset_common_write ; Store and return | |
441 | |
442 do_logoffset_plus10: | |
443 call do_logoffset_common_read ; Read into lo:hi | |
444 movlw d'10' | |
445 addwf lo | |
446 movlw d'0' | |
447 addwfc hi | |
448 goto do_logoffset_common_write ; Store and return | |
449 | |
450 do_dispsets_menu_3stack: | |
451 call menu_processor_pop | |
452 call menu_processor_pop | |
453 | |
454 do_dispsets_menu: | |
455 MENU_BEGIN tDispSets, .5 | |
456 MENU_OPTION tBright, oBrightness, 0 | |
457 MENU_OPTION tUnits, oUnits, 0 | |
458 MENU_CALL tLogOffset, do_log_offset_menu | |
459 MENU_OPTION tDvSalinity,oDiveSalinity, 0 | |
460 MENU_CALL tExit, do_return_settings | |
461 MENU_END | |
462 | |
463 ;============================================================================= | |
464 | |
465 global new_battery_menu | |
466 new_battery_menu: | |
467 bsf enable_screen_dumps ; To prevent exiting into COMM mode immediately | |
468 call TFT_boot ; Initialize TFT (includes clear screen) | |
469 call TFT_Display_FadeIn ; Show splash | |
470 movlw .100 | |
471 movwf batt_percent ; make sure to reset batt_percent | |
472 | |
473 ; Default (In cases of timeout or USB): Use old battery | |
474 clrf EEADRH | |
475 read_int_eeprom 0x07 | |
476 movff EEDATA,battery_gauge+0 | |
477 read_int_eeprom 0x08 | |
478 movff EEDATA,battery_gauge+1 | |
479 read_int_eeprom 0x09 | |
480 movff EEDATA,battery_gauge+2 | |
481 read_int_eeprom 0x0A | |
482 movff EEDATA,battery_gauge+3 | |
483 read_int_eeprom 0x0B | |
484 movff EEDATA,battery_gauge+4 | |
485 read_int_eeprom 0x0C | |
486 movff EEDATA,battery_gauge+5 | |
487 | |
488 MENU_BEGIN tNewBattTitle, .3 | |
489 MENU_CALL tNewBattOld, use_old_batteries | |
490 MENU_CALL tNewBattNew36, use_new_36V_batteries | |
491 MENU_CALL tNewBattNew15, use_new_15V_batteries | |
492 MENU_END | |
493 | |
494 global use_old_batteries | |
495 use_old_batteries: | |
496 clrf EEADRH | |
497 read_int_eeprom 0x07 | |
498 movff EEDATA,battery_gauge+0 | |
499 read_int_eeprom 0x08 | |
500 movff EEDATA,battery_gauge+1 | |
501 read_int_eeprom 0x09 | |
502 movff EEDATA,battery_gauge+2 | |
503 read_int_eeprom 0x0A | |
504 movff EEDATA,battery_gauge+3 | |
505 read_int_eeprom 0x0B | |
506 movff EEDATA,battery_gauge+4 | |
507 read_int_eeprom 0x0C | |
508 movff EEDATA,battery_gauge+5 | |
509 movlw .100 | |
510 movwf batt_percent ; To have 1,5V batteries right after firmware update | |
511 goto power_on_return | |
512 | |
513 use_new_15V_batteries: | |
514 use_new_36V_batteries: | |
515 call reset_battery_pointer ; Resets battery pointer 0x07-0x0C and battery_gauge:5 | |
516 goto power_on_return | |
517 | |
518 END |