comparison code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 382:f2d5d93b4ca3 64kByte Logbook

negative temperature in logbook and battery info menu
author heinrichsweikamp
date Wed, 15 Jun 2011 20:08:30 +0200
parents 61742b3ef842
children deced1cacff7
comparison
equal deleted inserted replaced
381:c7142538050c 382:f2d5d93b4ca3
863 call word_processor 863 call word_processor
864 WIN_LEFT .80 864 WIN_LEFT .80
865 WIN_TOP .177 865 WIN_TOP .177
866 STRCPY "temp:" 866 STRCPY "temp:"
867 SAFE_2BYTE_COPY temperature, lo 867 SAFE_2BYTE_COPY temperature, lo
868 call PLED_convert_signed_temperature ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
868 output_16 869 output_16
869 call word_processor 870 call word_processor
870 871
871 call get_battery_voltage ; get battery voltage 872 call get_battery_voltage ; get battery voltage
872 WIN_LEFT .0 873 WIN_LEFT .0
973 call PLED_standard_color 974 call PLED_standard_color
974 975
975 movff last_temperature+1,hi 976 movff last_temperature+1,hi
976 movff last_temperature+0,lo 977 movff last_temperature+0,lo
977 lfsr FSR2,letter 978 lfsr FSR2,letter
978 979 call PLED_convert_signed_temperature ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
979 btfss hi,7 ; Negative temperature ?
980 bra PLED_temp_surfmode_1 ; No: continue
981
982 PUTC '-' ; Display "-"
983
984 comf hi ; Then, 16bit sign changes.
985 negf lo
986 btfsc STATUS,C
987 incf hi
988
989 PLED_temp_surfmode_1:
990 movlw d'3' 980 movlw d'3'
991 movwf ignore_digits 981 movwf ignore_digits
992 bsf leftbind ; left orientated output 982 bsf leftbind ; left orientated output
993 output_16dp d'2' 983 output_16dp d'2'
994 bcf leftbind 984 bcf leftbind
1009 999
1010 movff last_temperature+1,hi 1000 movff last_temperature+1,hi
1011 movff last_temperature+0,lo 1001 movff last_temperature+0,lo
1012 1002
1013 lfsr FSR2,letter 1003 lfsr FSR2,letter
1014 1004 call PLED_convert_signed_temperature ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
1015 btfss hi,7 ; Negative temperature ?
1016 bra PLED_temp_divemode_1 ; No: continue
1017
1018 PUTC '-' ; Display "-"
1019
1020 comf hi ; Then, 16bit sign changes.
1021 negf lo
1022 btfsc STATUS,C
1023 incf hi
1024
1025 PLED_temp_divemode_1:
1026 movlw d'3' 1005 movlw d'3'
1027 movwf ignore_digits 1006 movwf ignore_digits
1028 bsf leftbind ; left orientated output 1007 bsf leftbind ; left orientated output
1029 output_16dp d'2' 1008 output_16dp d'2'
1030 bcf leftbind 1009 bcf leftbind
1904 1883
1905 update_batt_voltage2_full: 1884 update_batt_voltage2_full:
1906 movlw d'30' 1885 movlw d'30'
1907 movwf wait_temp 1886 movwf wait_temp
1908 bra update_batt_voltage2a 1887 bra update_batt_voltage2a
1888
1889 PLED_convert_signed_temperature:
1890 btfss hi,7 ; Negative temperature ?
1891 return ; No, return
1892 ; Yes, negative temperature!
1893 PUTC '-' ; Display "-"
1894 comf hi ; Then, 16bit sign changes.
1895 negf lo
1896 btfsc STATUS,C
1897 incf hi
1898 return ; and return
1909 1899
1910 PLED_convert_date: ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2 1900 PLED_convert_date: ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
1911 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) 1901 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD)
1912 tstfsz EEDATA 1902 tstfsz EEDATA
1913 bra PLED_convert_date1 1903 bra PLED_convert_date1