comparison code_part1/OSTC_code_asm_part1/menu_reset.asm @ 464:6ad9af3a5771 2.01stable

Fix reset gas from 2.0stable
author heinrichsweikamp
date Sun, 02 Oct 2011 17:52:16 +0200
parents 770456638c66
children 7779bfa89171
comparison
equal deleted inserted replaced
462:32e1174fb89e 464:6ad9af3a5771
322 clrf nofly_time+0 ; Reset NoFly 322 clrf nofly_time+0 ; Reset NoFly
323 clrf nofly_time+1 ; Reset NoFly 323 clrf nofly_time+1 ; Reset NoFly
324 bcf nofly_active ; Clear flag 324 bcf nofly_active ; Clear flag
325 325
326 ; reset gases 326 ; reset gases
327 clrf EEADRH ; EEPROM BANK 0 ! 327 rcall reset_gases
328
329 movlw d'3' ; address of first gas-1
330 movwf EEADR
331 clrf hi ; He part (default for all gases: 0%)
332 movlw d'21' ; O2 part (21%)
333 rcall reset_gas ; saves default and current value for gas #1
334 movlw d'21' ; O2 part (21%)
335 rcall reset_gas ; saves default and current value for gas #2
336 movlw d'21' ; O2 part (21%)
337 rcall reset_gas ; saves default and current value for gas #3
338 movlw d'21' ; O2 part (21%)
339 rcall reset_gas ; saves default and current value for gas #4
340 movlw d'21' ; O2 part (21%)
341 rcall reset_gas ; saves default and current value for gas #5
342 movlw d'21' ; O2 part (21%)
343 rcall reset_gas ; saves default and current value for gas #6
344 328
345 reset_all_cf: 329 reset_all_cf:
346 movlw d'1' 330 movlw d'1'
347 movwf EEDATA 331 movwf EEDATA
348 write_int_eeprom d'33' ; reset start gas 332 write_int_eeprom d'33' ; reset start gas
432 clrf EEADRH ; EEPROM BANK 0 ! 416 clrf EEADRH ; EEPROM BANK 0 !
433 417
434 ;call reset_external_eeprom ; delete profile memory 418 ;call reset_external_eeprom ; delete profile memory
435 goto restart ; all reset, quit to surfmode 419 goto restart ; all reset, quit to surfmode
436 420
421 reset_gases:
422 clrf EEADRH ; EEPROM BANK 0 !
423
424 movlw d'3' ; address of first gas-1
425 movwf EEADR
426 clrf hi ; He part (default for all gases: 0%)
427 movlw d'21' ; O2 part (21%)
428 rcall reset_gas ; saves current value for gas #1
429 movlw d'21' ; O2 part (21%)
430 rcall reset_gas ; saves default value for gas #1
431 movlw d'21' ; O2 part (21%)
432 rcall reset_gas ; saves current value for gas #2
433 movlw d'21' ; O2 part (21%)
434 rcall reset_gas ; saves default value for gas #2
435 movlw d'21' ; O2 part (21%)
436 rcall reset_gas ; saves current value for gas #3
437 movlw d'21' ; O2 part (21%)
438 rcall reset_gas ; saves default value for gas #3
439 movlw d'21' ; O2 part (21%)
440 rcall reset_gas ; saves current value for gas #4
441 movlw d'21' ; O2 part (21%)
442 rcall reset_gas ; saves default value for gas #4
443 movlw d'21' ; O2 part (21%)
444 rcall reset_gas ; saves current value for gas #5
445 movlw d'21' ; O2 part (21%)
446 rcall reset_gas ; saves default value for gas #5
447 movlw d'21' ; O2 part (21%)
448 rcall reset_gas ; saves current value for gas #6
449 return
450
437 ; Write WREG:lo twice, w/o any type clearing, pre-incrementing EEADR 451 ; Write WREG:lo twice, w/o any type clearing, pre-incrementing EEADR
438 reset_gas: 452 reset_gas:
439 movwf lo 453 movwf lo
440 incf EEADR,F 454 incf EEADR,F
441 movff lo, EEDATA ; Lowbyte Default value 455 movff lo, EEDATA ; O2 Default value
442 call write_eeprom 456 call write_eeprom
443 incf EEADR,F 457 incf EEADR,F
444 movff hi, EEDATA ; Highbyte default value 458 movff hi, EEDATA ; He default value
445 call write_eeprom 459 call write_eeprom
446 return 460 return
447 461
448 reset_customfunction: 462 reset_customfunction:
449 tblrd*+ 463 tblrd*+