comparison src/comm.asm @ 92:7ca1105751c7

add sensor calibration option (PC only), some cleanup
author heinrichsweikamp
date Wed, 16 Apr 2014 22:31:09 +0200
parents 8e13866b5496
children 53a99a2dc6a1
comparison
equal deleted inserted replaced
91:917393caf559 92:7ca1105751c7
625 cpfslt month 625 cpfslt month
626 movwf month 626 movwf month
627 call rs232_get_byte 627 call rs232_get_byte
628 btfsc rs232_recieve_overflow ; Got byte? 628 btfsc rs232_recieve_overflow ; Got byte?
629 return ; No, abort! 629 return ; No, abort!
630 rcall comm_check_day ; Check day 630 call comm_check_day ; Check day
631 call rs232_get_byte 631 call rs232_get_byte
632 btfsc rs232_recieve_overflow ; Got byte? 632 btfsc rs232_recieve_overflow ; Got byte?
633 return ; No, abort! 633 return ; No, abort!
634 movff RCREG1, year 634 movff RCREG1, year
635 movlw d'100' 635 movlw d'100'
918 bra comm_read_language ; RCREG1=0x32 918 bra comm_read_language ; RCREG1=0x32
919 dcfsnz WREG 919 dcfsnz WREG
920 bra comm_read_date_format ; RCREG1=0x33 920 bra comm_read_date_format ; RCREG1=0x33
921 dcfsnz WREG 921 dcfsnz WREG
922 bra comm_read_compass_gain ; RCREG1=0x34 922 bra comm_read_compass_gain ; RCREG1=0x34
923 dcfsnz WREG
924 bra comm_read_pressure_adjust ; RCREG1=0x35
923 925
924 926
925 927
926 comm_read_unused: 928 comm_read_unused:
927 comm_read_abort: 929 comm_read_abort:
1138 movff opt_dateformat, TXREG1 1140 movff opt_dateformat, TXREG1
1139 rcall comm_read_setting_wait ; Wait for UART 1141 rcall comm_read_setting_wait ; Wait for UART
1140 bra comm_download_mode0 ; Done. Loop with timeout reset 1142 bra comm_download_mode0 ; Done. Loop with timeout reset
1141 comm_read_compass_gain: 1143 comm_read_compass_gain:
1142 movff opt_compass_gain, TXREG1 1144 movff opt_compass_gain, TXREG1
1145 rcall comm_read_setting_wait ; Wait for UART
1146 bra comm_download_mode0 ; Done. Loop with timeout reset
1147 comm_read_pressure_adjust:
1148 movff opt_pressure_adjust, TXREG1
1143 rcall comm_read_setting_wait ; Wait for UART 1149 rcall comm_read_setting_wait ; Wait for UART
1144 bra comm_download_mode0 ; Done. Loop with timeout reset 1150 bra comm_download_mode0 ; Done. Loop with timeout reset
1145 1151
1146 ;----------------------------------------------------------------------------- 1152 ;-----------------------------------------------------------------------------
1147 1153
1257 bra comm_write_language ; RCREG1=0x32 1263 bra comm_write_language ; RCREG1=0x32
1258 dcfsnz WREG 1264 dcfsnz WREG
1259 bra comm_write_date_format ; RCREG1=0x33 1265 bra comm_write_date_format ; RCREG1=0x33
1260 dcfsnz WREG 1266 dcfsnz WREG
1261 bra comm_write_compass_gain ; RCREG1=0x34 1267 bra comm_write_compass_gain ; RCREG1=0x34
1268 dcfsnz WREG
1269 bra comm_write_pressure_adjust ; RCREG1=0x35
1262 1270
1263 comm_write_unused: 1271 comm_write_unused:
1264 comm_write_abort: 1272 comm_write_abort:
1265 ; Check Options, gases and diluents 1273 ; Check Options, gases and diluents
1266 call option_check_all ; Check all options (and reset if not within their min/max boundaries) 1274 call option_check_all ; Check all options (and reset if not within their min/max boundaries)
1490 movff RCREG1, opt_dateformat 1498 movff RCREG1, opt_dateformat
1491 bra comm_write_abort ; Done. Loop with timeout reset 1499 bra comm_write_abort ; Done. Loop with timeout reset
1492 comm_write_compass_gain: 1500 comm_write_compass_gain:
1493 call rs232_get_byte 1501 call rs232_get_byte
1494 movff RCREG1, opt_compass_gain 1502 movff RCREG1, opt_compass_gain
1503 bra comm_write_abort ; Done. Loop with timeout reset
1504 comm_write_pressure_adjust:
1505 call rs232_get_byte
1506 movff RCREG1, opt_pressure_adjust
1495 bra comm_write_abort ; Done. Loop with timeout reset 1507 bra comm_write_abort ; Done. Loop with timeout reset
1496 1508
1497 ;----------------------------------------------------------------------------- 1509 ;-----------------------------------------------------------------------------
1498 1510
1499 comm_send_string: 1511 comm_send_string: