Added unit test to rs485 windows port to allow sending a string of ascii hex out the rs485 port to inject messages onto the wire.
This commit is contained in:
@@ -667,6 +667,17 @@ static void MSTP_Receive_Frame_FSM(
|
||||
return;
|
||||
}
|
||||
|
||||
static MSTP_MASTER_STATE Master_State_Log[128];
|
||||
static unsigned master_state_log_index = 0;
|
||||
void log_master_state(MSTP_MASTER_STATE state)
|
||||
{
|
||||
Master_State_Log[master_state_log_index] = state;
|
||||
master_state_log_index++;
|
||||
if (master_state_log_index > 128) {
|
||||
master_state_log_index = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* returns true if we need to transition immediately */
|
||||
static bool MSTP_Master_Node_FSM(
|
||||
void)
|
||||
@@ -704,6 +715,7 @@ static bool MSTP_Master_Node_FSM(
|
||||
next_poll_station = (Poll_Station + 1) % (Nmax_master + 1);
|
||||
next_this_station = (This_Station + 1) % (Nmax_master + 1);
|
||||
next_next_station = (Next_Station + 1) % (Nmax_master + 1);
|
||||
log_master_state(Master_State);
|
||||
switch (Master_State) {
|
||||
case MSTP_MASTER_STATE_INITIALIZE:
|
||||
/* DoneInitializing */
|
||||
|
||||
@@ -46,8 +46,8 @@ static uint32_t Baud_Rate = 9600;
|
||||
/* turnaround_time_milliseconds = (Tturnaround*1000UL)/Baud_Rate; */
|
||||
|
||||
/* buffer for storing received bytes - size must be power of two */
|
||||
static uint8_t Receive_Buffer_Data[128];
|
||||
static FIFO_BUFFER Receive_Buffer;
|
||||
uint8_t Receive_Buffer_Data[128];
|
||||
FIFO_BUFFER Receive_Buffer;
|
||||
|
||||
static void rs485_rts_init(
|
||||
void)
|
||||
|
||||
Reference in New Issue
Block a user