comparison src/comm.asm @ 235:23311219dacc

under construction: new hardware_flag to configure different hardware versions
author heinrichsweikamp
date Wed, 25 Feb 2015 16:49:59 +0100
parents 940155e9aefb
children 49512af55afc
comparison
equal deleted inserted replaced
234:57155164faad 235:23311219dacc
92 bcf onesecupdate 92 bcf onesecupdate
93 bcf LEDr 93 bcf LEDr
94 dcfsnz timeout_counter,F 94 dcfsnz timeout_counter,F
95 bra comm_service_exit ; Timeout -> Exit 95 bra comm_service_exit ; Timeout -> Exit
96 comm_mode2: 96 comm_mode2:
97 btfsc cr_hardware 97 btfsc rechargeable
98 bra comm_mode4 ; Skip 98 bra comm_mode4 ; Skip
99 99
100 call get_battery_voltage ; gets battery voltage 100 call get_battery_voltage ; gets battery voltage
101 movlw .3 101 movlw .3
102 cpfslt batt_voltage+1 ; Batt Voltage less then 3*256mV? 102 cpfslt batt_voltage+1 ; Batt Voltage less then 3*256mV?
482 bra comm_send_dive ; Send header and profile for one dive 482 bra comm_send_dive ; Send header and profile for one dive
483 movlw "i" 483 movlw "i"
484 cpfseq RCREG1 484 cpfseq RCREG1
485 bra $+4 485 bra $+4
486 bra comm_identify ; Send firmware, serial, etc. 486 bra comm_identify ; Send firmware, serial, etc.
487 movlw "j"
488 cpfseq RCREG1
489 bra $+4
490 bra comm_hardware_descriptor ; Send hardware descriptor byte
487 movlw "n" 491 movlw "n"
488 cpfseq RCREG1 492 cpfseq RCREG1
489 bra $+4 493 bra $+4
490 goto comm_send_string ; Send a 15byte string to the screen 494 goto comm_send_string ; Send a 15byte string to the screen
491 movlw "l" 495 movlw "l"
722 decfsz hi,F 726 decfsz hi,F
723 bra common_identify_loop 727 bra common_identify_loop
724 728
725 bra comm_download_mode0 ; Done. 729 bra comm_download_mode0 ; Done.
726 730
731 ;-----------------------------------------------------------------------------
732 ; Reply hardware descriptor byte
733 ;
734
735 comm_hardware_descriptor:
736 movlw "j" ; send echo
737 movwf TXREG1
738 call rs232_wait_tx ; wait for UART
739 movff hardware_flag,TXREG1
740 call rs232_wait_tx ; wait for UART
741 bra comm_download_mode0 ; Done.
727 742
728 ;----------------------------------------------------------------------------- 743 ;-----------------------------------------------------------------------------
729 744
730 comm_send_dive: 745 comm_send_dive:
731 movlw "f" ; send echo 746 movlw "f" ; send echo