feat(rs232): enable SCI-A FIFO on PM35 and preserve RS485
This commit is contained in:
@@ -10,6 +10,10 @@
|
||||
//#include "cntrl_adr.h"
|
||||
//#include "params.h"
|
||||
|
||||
#ifndef RS232_USE_FIFO
|
||||
#define RS232_USE_FIFO 1
|
||||
#endif
|
||||
|
||||
#define COM_1 1
|
||||
#define COM_2 2
|
||||
|
||||
@@ -58,6 +62,10 @@ typedef struct
|
||||
int RS_FlagSkiping;
|
||||
unsigned long curr_baud;
|
||||
unsigned long time_wait_rs_out;
|
||||
#if RS232_USE_FIFO
|
||||
volatile unsigned int fifo_tx_active, fifo_rx_guard;
|
||||
volatile unsigned long fifo_rx_errors, fifo_overflows;
|
||||
#endif
|
||||
|
||||
} RS_DATA;
|
||||
|
||||
@@ -106,7 +114,13 @@ void RS_SetLineSpeed(RS_DATA *rs_arr, unsigned long speed);
|
||||
|
||||
// Îæèäàíèå çàâåðøåíèà ïåðåäà÷è UART
|
||||
// wait for TRDY =1 for empty state
|
||||
#if RS232_USE_FIFO
|
||||
void RS_FifoWait(RS_DATA *rs_arr);
|
||||
void RS_FifoTick1ms(void);
|
||||
#define RS_Wait4OK(x) RS_FifoWait(x)
|
||||
#else
|
||||
#define RS_Wait4OK(x) while(!(x->SciRegs->SCICTL2.bit.TXEMPTY))
|
||||
#endif
|
||||
|
||||
/** Ïåðåêëþ÷åíèå ëèíèè íà ïðèåì */
|
||||
#define RS_Line_to_receive(x) if(x->commnumber==COM_2) GpioDataRegs.GPBDAT.bit.GPIO34 = 1;
|
||||
|
||||
Reference in New Issue
Block a user