Updated PIC18 port.
This commit is contained in:
@@ -36,11 +36,12 @@
|
||||
#include "npdu.h"
|
||||
|
||||
/* receive buffer */
|
||||
#pragma udata MSTPPortData
|
||||
static DLMSTP_PACKET Receive_Buffer;
|
||||
/* temp buffer for NPDU insertion */
|
||||
static uint8_t PDU_Buffer[MAX_MPDU];
|
||||
/* local MS/TP port data */
|
||||
static volatile struct mstp_port_struct_t MSTP_Port;
|
||||
/* local MS/TP port data - shared with RS-485 */
|
||||
volatile struct mstp_port_struct_t MSTP_Port;
|
||||
|
||||
void dlmstp_init(void)
|
||||
{
|
||||
@@ -132,7 +133,7 @@ uint16_t dlmstp_receive(BACNET_ADDRESS * src, /* source address */
|
||||
/* only do master state machine while rx is idle */
|
||||
if (MSTP_Port.receive_state == MSTP_RECEIVE_STATE_IDLE) {
|
||||
while (MSTP_Master_Node_FSM(&MSTP_Port)) {};
|
||||
}
|
||||
}
|
||||
/* see if there is a packet available */
|
||||
if (Receive_Buffer.ready) {
|
||||
memmove(src, &Receive_Buffer.address,
|
||||
@@ -141,6 +142,7 @@ uint16_t dlmstp_receive(BACNET_ADDRESS * src, /* source address */
|
||||
memmove(&pdu[0], &Receive_Buffer.pdu[0], max_pdu);
|
||||
Receive_Buffer.ready = false;
|
||||
}
|
||||
RS485_Process_Tx_Message();
|
||||
|
||||
return pdu_len;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user