comparison code_part1/OSTC_code_asm_part1/menu_reset.asm @ 681:6e456a6398e0

Hardware4 support
author heinrichsweikamp
date Fri, 25 Jan 2013 18:00:49 +0100
parents c6220d340684
children aebb6d039249
comparison
equal deleted inserted replaced
680:c6220d340684 681:6e456a6398e0
234 234
235 menu_reset: 235 menu_reset:
236 movlw d'1' 236 movlw d'1'
237 movwf menupos 237 movwf menupos
238 238
239 call PLED_ClearScreen 239 call DISP_ClearScreen
240 call PLED_reset_menu_mask 240 call DISP_reset_menu_mask
241 241
242 menu_reset2: 242 menu_reset2:
243 call menu_pre_loop_common ; Clear some menu flags, timeout and switches 243 call menu_pre_loop_common ; Clear some menu flags, timeout and switches
244 call PLED_reset_menu_mask 244 call DISP_reset_menu_mask
245 call PLED_menu_cursor 245 call DISP_menu_cursor
246 menu_reset_loop: 246 menu_reset_loop:
247 call check_switches_menu 247 call check_switches_menu
248 btfsc menubit2 248 btfsc menubit2
249 bra do_menu_reset ; call submenu 249 bra do_menu_reset ; call submenu
250 btfss menubit 250 btfss menubit
279 movwf menupos 279 movwf menupos
280 bra menu2 ; exit... 280 bra menu2 ; exit...
281 281
282 282
283 do_menu_reset_reboot: 283 do_menu_reset_reboot:
284 call PLED_confirmbox ; Returns WREG=0 for Cancel (Or Timeout) and WREG=1 for OK! 284 call DISP_confirmbox ; Returns WREG=0 for Cancel (Or Timeout) and WREG=1 for OK!
285 movwf menupos ; Used as temp 285 movwf menupos ; Used as temp
286 tstfsz menupos 286 tstfsz menupos
287 bra do_menu_reset_reboot2 ; Delete now! 287 bra do_menu_reset_reboot2 ; Delete now!
288 bra do_menu_reset_exit ; Cancel! 288 bra do_menu_reset_exit ; Cancel!
289 289
290 do_menu_reset_reboot2: 290 do_menu_reset_reboot2:
291 call PLED_DisplayOff ; Power-down OLED 291 call DISP_DisplayOff ; Power-down DISPLAY
292 movlw b'00000000' ; Bit6: PPL Disable 292 movlw b'00000000' ; Bit6: PPL Disable
293 movwf OSCTUNE 293 movwf OSCTUNE
294 movlw b'01111110' ; 8MHz 294 movlw b'01111110' ; 8MHz
295 movwf OSCCON 295 movwf OSCCON
296 reset 296 reset
297 goto 0x00000 ; restart to 0x00000 297 goto 0x00000 ; restart to 0x00000
298 298
299 do_menu_reset_logbook: 299 do_menu_reset_logbook:
300 call PLED_confirmbox ; Returns WREG=0 for Cancel (Or Timeout) and WREG=1 for OK! 300 call DISP_confirmbox ; Returns WREG=0 for Cancel (Or Timeout) and WREG=1 for OK!
301 movwf menupos ; Used as temp 301 movwf menupos ; Used as temp
302 tstfsz menupos 302 tstfsz menupos
303 bra do_menu_reset_logbook2 ; Delete Logbook now! 303 bra do_menu_reset_logbook2 ; Delete Logbook now!
304 bra do_menu_reset_exit ; Cancel! 304 bra do_menu_reset_exit ; Cancel!
305 305
306 do_menu_reset_logbook2: 306 do_menu_reset_logbook2:
307 call PLED_ClearScreen 307 call DISP_ClearScreen
308 setf win_color1 ; Make sure to display in white color. 308 setf win_color1 ; Make sure to display in white color.
309 setf win_color2 309 setf win_color2
310 DISPLAYTEXT .25 ; "Reset..." 310 DISPLAYTEXT .25 ; "Reset..."
311 call reset_external_eeprom ; delete profile memory 311 call reset_external_eeprom ; delete profile memory
312 bra do_menu_reset_exit 312 bra do_menu_reset_exit
313 313
314 do_menu_reset_decodata: 314 do_menu_reset_decodata:
315 call PLED_confirmbox ; Returns WREG=0 for Cancel (Or Timeout) and WREG=1 for OK! 315 call DISP_confirmbox ; Returns WREG=0 for Cancel (Or Timeout) and WREG=1 for OK!
316 movwf menupos ; Used as temp 316 movwf menupos ; Used as temp
317 tstfsz menupos 317 tstfsz menupos
318 bra do_menu_reset_decodata2 ; Reset Deco Data now! 318 bra do_menu_reset_decodata2 ; Reset Deco Data now!
319 bra do_menu_reset_exit ; Cancel! 319 bra do_menu_reset_exit ; Cancel!
320 320
321 do_menu_reset_decodata2: 321 do_menu_reset_decodata2:
322 ; reset deco data 322 ; reset deco data
323 call PLED_ClearScreen 323 call DISP_ClearScreen
324 DISPLAYTEXT .25 ; "Reset..." 324 DISPLAYTEXT .25 ; "Reset..."
325 325
326 SAFE_2BYTE_COPY amb_pressure,int_I_pres_respiration ; copy surface air pressure to deco routine 326 SAFE_2BYTE_COPY amb_pressure,int_I_pres_respiration ; copy surface air pressure to deco routine
327 call deco_clear_tissue ; Reset Decodata 327 call deco_clear_tissue ; Reset Decodata
328 call deco_calc_desaturation_time ; calculate desaturation time 328 call deco_calc_desaturation_time ; calculate desaturation time
332 clrf nofly_time+1 ; Reset NoFly 332 clrf nofly_time+1 ; Reset NoFly
333 bcf nofly_active ; Clear flag 333 bcf nofly_active ; Clear flag
334 goto restart ; done. quit to surfmode 334 goto restart ; done. quit to surfmode
335 335
336 do_menu_reset_all: 336 do_menu_reset_all:
337 call PLED_confirmbox ; Returns WREG=0 for Cancel (Or Timeout) and WREG=1 for OK! 337 call DISP_confirmbox ; Returns WREG=0 for Cancel (Or Timeout) and WREG=1 for OK!
338 movwf menupos ; Used as temp 338 movwf menupos ; Used as temp
339 tstfsz menupos 339 tstfsz menupos
340 bra do_menu_reset_all2 ; Reset all now! 340 bra do_menu_reset_all2 ; Reset all now!
341 bra do_menu_reset_exit ; Cancel! 341 bra do_menu_reset_exit ; Cancel!
342 342
343 do_menu_reset_all2: 343 do_menu_reset_all2:
344 call PLED_ClearScreen 344 call DISP_ClearScreen
345 DISPLAYTEXT .25 ; "Reset..." 345 DISPLAYTEXT .25 ; "Reset..."
346 346
347 reset_start: 347 reset_start:
348 ; reset deco data 348 ; reset deco data
349 SAFE_2BYTE_COPY amb_pressure,int_I_pres_respiration ; copy surface air pressure to deco routine 349 SAFE_2BYTE_COPY amb_pressure,int_I_pres_respiration ; copy surface air pressure to deco routine