# HG changeset patch # User heinrichsweikamp # Date 1308161310 -7200 # Node ID f2d5d93b4ca351733fc2cb4ea9841bfee47253b1 # Parent c7142538050c1c3f9a09d467e9fc8a9d26eea18b negative temperature in logbook and battery info menu diff -r c7142538050c -r f2d5d93b4ca3 code_part1/OSTC_code_asm_part1/changelog.txt --- a/code_part1/OSTC_code_asm_part1/changelog.txt Wed Jun 15 11:30:51 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/changelog.txt Wed Jun 15 20:08:30 2011 +0200 @@ -8,6 +8,7 @@ NEW: Allow -2:00 to +2:00 adjustement per day (CF48). NEW: 1/10/100 steps in CF menu NEW: 64kByte Logbook (Doubled capacity compared to 1.90) +BUGFIX: Negative temperatures in logbook and battery information menu New in 1.90 Stable: Stable release diff -r c7142538050c -r f2d5d93b4ca3 code_part1/OSTC_code_asm_part1/menu_battery.asm --- a/code_part1/OSTC_code_asm_part1/menu_battery.asm Wed Jun 15 11:30:51 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/menu_battery.asm Wed Jun 15 20:08:30 2011 +0200 @@ -96,6 +96,7 @@ movff EEDATA,lo read_int_eeprom d'55' ; TEMP_min HIGH movff EEDATA,hi + call PLED_convert_signed_temperature ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required movlw d'3' movwf ignore_digits bsf leftbind ; left orientated output @@ -118,6 +119,7 @@ movff EEDATA,lo read_int_eeprom d'60' ; TEMP_max HIGH movff EEDATA,hi + call PLED_convert_signed_temperature ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required movlw d'3' movwf ignore_digits bsf leftbind ; left orientated output diff -r c7142538050c -r f2d5d93b4ca3 code_part1/OSTC_code_asm_part1/menu_logbook.asm --- a/code_part1/OSTC_code_asm_part1/menu_logbook.asm Wed Jun 15 11:30:51 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/menu_logbook.asm Wed Jun 15 20:08:30 2011 +0200 @@ -459,11 +459,12 @@ call I2CREAD2 movff SSPBUF,lo call I2CREAD2 - movff SSPBUF,hi + movff SSPBUF,hi ; Read min. Temperature + call PLED_convert_signed_temperature ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required movlw d'3' movwf ignore_digits bsf leftbind - output_16dp d'2' ; temperature + output_16dp d'2' ; temperature STRCAT_PRINT "°C" ; Display 2nd row of details WIN_TOP .50 diff -r c7142538050c -r f2d5d93b4ca3 code_part1/OSTC_code_asm_part1/pled_outputs.asm --- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm Wed Jun 15 11:30:51 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm Wed Jun 15 20:08:30 2011 +0200 @@ -865,6 +865,7 @@ WIN_TOP .177 STRCPY "temp:" SAFE_2BYTE_COPY temperature, lo + call PLED_convert_signed_temperature ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required output_16 call word_processor @@ -975,18 +976,7 @@ movff last_temperature+1,hi movff last_temperature+0,lo lfsr FSR2,letter - - btfss hi,7 ; Negative temperature ? - bra PLED_temp_surfmode_1 ; No: continue - - PUTC '-' ; Display "-" - - comf hi ; Then, 16bit sign changes. - negf lo - btfsc STATUS,C - incf hi - -PLED_temp_surfmode_1: + call PLED_convert_signed_temperature ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required movlw d'3' movwf ignore_digits bsf leftbind ; left orientated output @@ -1011,18 +1001,7 @@ movff last_temperature+0,lo lfsr FSR2,letter - - btfss hi,7 ; Negative temperature ? - bra PLED_temp_divemode_1 ; No: continue - - PUTC '-' ; Display "-" - - comf hi ; Then, 16bit sign changes. - negf lo - btfsc STATUS,C - incf hi - -PLED_temp_divemode_1: + call PLED_convert_signed_temperature ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required movlw d'3' movwf ignore_digits bsf leftbind ; left orientated output @@ -1907,6 +1886,17 @@ movwf wait_temp bra update_batt_voltage2a +PLED_convert_signed_temperature: + btfss hi,7 ; Negative temperature ? + return ; No, return +; Yes, negative temperature! + PUTC '-' ; Display "-" + comf hi ; Then, 16bit sign changes. + negf lo + btfsc STATUS,C + incf hi + return ; and return + PLED_convert_date: ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) tstfsz EEDATA