Mercurial > public > hwos_code
comparison src/start.asm @ 133:939f1e83c4c2
BUGFIX: Surface interval was not displayed correctly in some cases
NEW: Store tissue load, date and time, surface interval, desat. time and nofly time every hour and reload them after battery change
author | heinrichsweikamp |
---|---|
date | Mon, 14 Jul 2014 15:17:07 +0200 |
parents | f3062a611eef |
children | fdd4e30846ae |
comparison
equal
deleted
inserted
replaced
132:ec0b1e829399 | 133:939f1e83c4c2 |
---|---|
110 movff int_I_pres_respiration+0,int_I_pres_surface+0 ; copy for desat routine | 110 movff int_I_pres_respiration+0,int_I_pres_surface+0 ; copy for desat routine |
111 movff int_I_pres_respiration+1,int_I_pres_surface+1 | 111 movff int_I_pres_respiration+1,int_I_pres_surface+1 |
112 | 112 |
113 extern deco_reset | 113 extern deco_reset |
114 call deco_reset | 114 call deco_reset |
115 call deco_calc_desaturation_time ; calculate desaturation time | |
116 banksel common | |
117 call deco_calc_wo_deco_step_1_min ; calculate deco in surface mode | |
118 banksel common | |
119 clrf nofly_time+0 ; Reset NoFly | 115 clrf nofly_time+0 ; Reset NoFly |
120 clrf nofly_time+1 | 116 clrf nofly_time+1 |
121 clrf desaturation_time+0 ; Reset Desat | 117 clrf desaturation_time+0 ; Reset Desat |
122 clrf desaturation_time+1 | 118 clrf desaturation_time+1 |
119 | |
120 call rtc_init ; init clock | |
121 | |
122 movlw HIGH .512 ; =2 | |
123 movwf EEADRH | |
124 read_int_eeprom .0 | |
125 clrf EEADRH | |
126 movlw 0xAA | |
127 cpfseq EEDATA ; =0xAA | |
128 bra no_deco_restore ; No | |
129 | |
130 extern restore_decodata_from_eeprom | |
131 call restore_decodata_from_eeprom ; Reload deco data and date/time from eeprom | |
132 | |
133 no_deco_restore: | |
134 call deco_calc_desaturation_time ; calculate desaturation time | |
135 banksel common | |
136 call deco_calc_wo_deco_step_1_min ; calculate deco in surface mode | |
137 banksel common | |
123 bcf menubit ; clear menu flag | 138 bcf menubit ; clear menu flag |
124 ; Check for Power-on reset here | 139 ; Check for Power-on reset here |
125 extern new_battery_menu | 140 extern new_battery_menu |
126 extern use_old_batteries | 141 extern use_old_batteries |
127 | 142 |
128 btfsc RCON,POR ; Was this a power-on reset? | 143 btfsc RCON,POR ; Was this a power-on reset? |
129 goto use_old_batteries ; No, load last stored battery values | 144 goto use_old_batteries ; No, load last stored battery values |
130 ; "new_battery_menu" and "use_old_batteries" 'goto' back to "power_on_return" | 145 ; "new_battery_menu" and "use_old_batteries" 'goto' back to "power_on_return" |
131 | 146 |
132 ; Yes | 147 ; Yes |
133 call rtc_init ; init clock | |
134 goto new_battery_menu ; show "New battery dialog" | 148 goto new_battery_menu ; show "New battery dialog" |
135 ; "new_battery_menu" and "use_old_batteries" 'goto' back to "power_on_return" | 149 ; "new_battery_menu" and "use_old_batteries" 'goto' back to "power_on_return" |
136 | 150 |
137 global power_on_return | 151 global power_on_return |
138 power_on_return: | 152 power_on_return: |
261 call ext_flash_disable_protection ; Disable write protection for external flash | 275 call ext_flash_disable_protection ; Disable write protection for external flash |
262 | 276 |
263 extern testloop | 277 extern testloop |
264 ; goto testloop | 278 ; goto testloop |
265 | 279 |
280 | |
281 | |
266 goto surfloop ; Jump to Surfaceloop! | 282 goto surfloop ; Jump to Surfaceloop! |
267 | 283 |
268 ;============================================================================= | 284 ;============================================================================= |
269 ; Setup all flags and parameters for divemode and simulator computations. | 285 ; Setup all flags and parameters for divemode and simulator computations. |
270 ; | 286 ; |