1 ;======================================================================
2 ; SERIAL PORT - TRANSMISSION TO HOST
6 ;----------------------------------------
8 ; W byte to xmit to host trashed
9 ; FSR0 any set for serial_addbyte_another
10 ; outbuf, outmsg_* buffer not full adjusted appropriately
12 ; all others any not interfered with
15 mov_ff outmsg_end, FSR0L
16 bs_f PIR1, TXIE ; ensure we get interrupted and try to xmit
18 serial_addbyte_another
19 ; W byte to xmit to host trashed
20 ; FSR0 from _addbyte[_another] updated for ..._another again
21 ; outbuf, outmsg_* buffer not full adjusted appropriately
23 ; all others any not interfered with
29 cmp_fw_ifne outmsg_begin
34 ;----------------------------------------------------------------------
37 rcall portb_read ; check flow control
39 ; are we ready to transmit ?
53 bra_n tx_justsent_noacknmra
54 ; we've just sent the last byte of some message:
55 ; maybe we push an NMRADONE message on the front
57 bra_nz tx_acknmra_insert
60 bc_f outmsg_begin, outbuf_szln2
61 call led_green ; we're transmitting
62 goto i2c_consider_restartread
65 ; maybe we send an NMRADONE
67 bra_nz tx_acknmra_send
68 ; nothing at all to do:
70 goto led_black ; we're not transmitting
73 sub_wff acknmra ; we're acking these now
74 mov_wf INDF0 ; write it over the message we just sent
78 sub_wff acknmra ; we're acking these now
82 ;----------------------------------------
84 ; W undefined value from PORTB
88 bt_w_if0 p0_rs232_fcin >> 4
99 goto led_red ; flow control forces us not to transmit
101 ;----------------------------------------------------------------------
108 ;----------------------------------------------------------------------
115 ;======================================================================