# HG changeset patch # User heinrichsweikamp # Date 1307943959 -7200 # Node ID be71e563ac098fb1b5b49f094ea462950ba1f728 # Parent ed26990716fe713d301f3a7b59da5f982d3840ce First gas can be reset to 0m, test for timer1 race condition diff -r ed26990716fe -r be71e563ac09 code_part1/OSTC_code_asm_part1/MAIN.ASM --- a/code_part1/OSTC_code_asm_part1/MAIN.ASM Sun Jun 12 21:27:07 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/MAIN.ASM Mon Jun 13 07:45:59 2011 +0200 @@ -68,6 +68,10 @@ btfsc INTCON3,INT1IF ; switch right call switch_right_int +; Test for race condition + btfsc PIR1,TMR1IF ;Timer1 INT (external 32.768kHz Clock) + call timer1int + movff prod_temp+1,PRODH movff prod_temp+0,PRODL movff wreg_temp,WREG ;restore working register diff -r ed26990716fe -r be71e563ac09 code_part1/OSTC_code_asm_part1/isr.asm --- a/code_part1/OSTC_code_asm_part1/isr.asm Sun Jun 12 21:27:07 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/isr.asm Mon Jun 13 07:45:59 2011 +0200 @@ -395,7 +395,8 @@ return clrf hours incf day,F - movff time_correction_value,secs ; Correct too slow clock +; Test for race condition +; movff time_correction_value,secs ; Correct too slow clock check_date: movff month,isr_divB ; new month? diff -r ed26990716fe -r be71e563ac09 code_part1/OSTC_code_asm_part1/menu_gassetup.asm --- a/code_part1/OSTC_code_asm_part1/menu_gassetup.asm Sun Jun 12 21:27:07 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/menu_gassetup.asm Mon Jun 13 07:45:59 2011 +0200 @@ -903,10 +903,13 @@ cpfslt lo movwf lo ; limit to 99m + btfsc second_FA ; Is first gas? + clrf lo ; Yes, set to 0m + movf decodata+0,W ; read current value addlw d'28' ; offset in memory movwf EEADR - call read_eeprom ; Low-value +; call read_eeprom ; Low-value movff lo,EEDATA ; write result call write_eeprom ; save result in EEPROM