Added optional local print for mstp monitor.
This commit is contained in:
@@ -59,6 +59,10 @@
|
|||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef LOCAL_PRINT
|
||||||
|
#define LOCAL_PRINT 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* local port data - shared with RS-485 */
|
/* local port data - shared with RS-485 */
|
||||||
static volatile struct mstp_port_struct_t MSTP_Port;
|
static volatile struct mstp_port_struct_t MSTP_Port;
|
||||||
/* buffers needed by mstp port struct */
|
/* buffers needed by mstp port struct */
|
||||||
@@ -236,7 +240,7 @@ static void cleanup(
|
|||||||
pFile = NULL;
|
pFile = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if LOCAL_PRINT
|
||||||
static void print_received_packet(
|
static void print_received_packet(
|
||||||
volatile struct mstp_port_struct_t *mstp_port)
|
volatile struct mstp_port_struct_t *mstp_port)
|
||||||
{
|
{
|
||||||
@@ -340,7 +344,7 @@ int main(
|
|||||||
/* process the data portion of the frame */
|
/* process the data portion of the frame */
|
||||||
if (mstp_port->ReceivedValidFrame) {
|
if (mstp_port->ReceivedValidFrame) {
|
||||||
mstp_port->ReceivedValidFrame = false;
|
mstp_port->ReceivedValidFrame = false;
|
||||||
#if 0
|
#if LOCAL_PRINT
|
||||||
print_received_packet(mstp_port);
|
print_received_packet(mstp_port);
|
||||||
#endif
|
#endif
|
||||||
write_received_packet(mstp_port);
|
write_received_packet(mstp_port);
|
||||||
@@ -348,7 +352,7 @@ int main(
|
|||||||
} else if (mstp_port->ReceivedInvalidFrame) {
|
} else if (mstp_port->ReceivedInvalidFrame) {
|
||||||
mstp_port->ReceivedInvalidFrame = false;
|
mstp_port->ReceivedInvalidFrame = false;
|
||||||
fprintf(stderr, "ReceivedInvalidFrame\n");
|
fprintf(stderr, "ReceivedInvalidFrame\n");
|
||||||
#if 0
|
#if LOCAL_PRINT
|
||||||
print_received_packet(mstp_port);
|
print_received_packet(mstp_port);
|
||||||
#endif
|
#endif
|
||||||
write_received_packet(mstp_port);
|
write_received_packet(mstp_port);
|
||||||
|
|||||||
Reference in New Issue
Block a user