Updated rx_fsm for Win32 port. Used for monitoring ms/tp stream from USB-RS485 dongle.
This commit is contained in:
@@ -277,12 +277,12 @@ void RS485_Send_Frame(
|
|||||||
uint8_t * buffer, /* frame to send (up to 501 bytes of data) */
|
uint8_t * buffer, /* frame to send (up to 501 bytes of data) */
|
||||||
uint16_t nbytes) /* number of bytes of data (up to 501) */
|
uint16_t nbytes) /* number of bytes of data (up to 501) */
|
||||||
{
|
{
|
||||||
uint8_t turnaround_time;
|
|
||||||
uint32_t baud;
|
|
||||||
DWORD dwWritten = 0;
|
DWORD dwWritten = 0;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (mstp_port) {
|
if (mstp_port) {
|
||||||
|
uint32_t baud;
|
||||||
|
uint8_t turnaround_time;
|
||||||
baud = RS485_Get_Baud_Rate();
|
baud = RS485_Get_Baud_Rate();
|
||||||
/* wait about 40 bit times since reception */
|
/* wait about 40 bit times since reception */
|
||||||
if (baud == 9600)
|
if (baud == 9600)
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
#include "bytes.h"
|
#include "bytes.h"
|
||||||
#include "rs485.h"
|
#include "rs485.h"
|
||||||
#include "mstp.h"
|
#include "mstp.h"
|
||||||
|
#include "mstptext.h"
|
||||||
#include "crc.h"
|
#include "crc.h"
|
||||||
|
|
||||||
#define INCREMENT_AND_LIMIT_UINT16(x) {if (x < 0xFFFF) x++;}
|
#define INCREMENT_AND_LIMIT_UINT16(x) {if (x < 0xFFFF) x++;}
|
||||||
@@ -122,6 +123,8 @@ static void print_received_packet(
|
|||||||
mstp_port->DataCRCActualMSB,
|
mstp_port->DataCRCActualMSB,
|
||||||
mstp_port->DataCRCActualLSB);
|
mstp_port->DataCRCActualLSB);
|
||||||
}
|
}
|
||||||
|
fprintf(stderr,"%s",
|
||||||
|
mstptext_frame_type(mstp_port->FrameType));
|
||||||
fprintf(stderr,"\n");
|
fprintf(stderr,"\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,6 @@
|
|||||||
<Option compiler="gcc" />
|
<Option compiler="gcc" />
|
||||||
<Compiler>
|
<Compiler>
|
||||||
<Add option="-g" />
|
<Add option="-g" />
|
||||||
<Add option="-DBIG_ENDIAN=0" />
|
|
||||||
<Add option="-DBACDL_MSTP=1" />
|
|
||||||
<Add directory="." />
|
<Add directory="." />
|
||||||
<Add directory="..\..\" />
|
<Add directory="..\..\" />
|
||||||
</Compiler>
|
</Compiler>
|
||||||
@@ -35,19 +33,31 @@
|
|||||||
<Compiler>
|
<Compiler>
|
||||||
<Add option="-Wall" />
|
<Add option="-Wall" />
|
||||||
<Add option="-fexceptions" />
|
<Add option="-fexceptions" />
|
||||||
|
<Add option="-DBIG_ENDIAN=0" />
|
||||||
|
<Add option="-DBACDL_MSTP=1" />
|
||||||
|
<Add directory="." />
|
||||||
|
<Add directory="..\..\..\bacnet-stack" />
|
||||||
</Compiler>
|
</Compiler>
|
||||||
<Unit filename="..\..\crc.c">
|
<Unit filename="..\..\crc.c">
|
||||||
<Option compilerVar="CC" />
|
<Option compilerVar="CC" />
|
||||||
</Unit>
|
</Unit>
|
||||||
<Unit filename="..\..\crc.h" />
|
<Unit filename="..\..\crc.h" />
|
||||||
<Unit filename="mstp.c">
|
<Unit filename="..\..\indtext.c">
|
||||||
<Option compilerVar="CC" />
|
<Option compilerVar="CC" />
|
||||||
</Unit>
|
</Unit>
|
||||||
|
<Unit filename="..\..\indtext.h" />
|
||||||
|
<Unit filename="..\..\mstp.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="..\..\mstp.h" />
|
||||||
|
<Unit filename="..\..\mstptext.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="..\..\mstptext.h" />
|
||||||
<Unit filename="mstp.h" />
|
<Unit filename="mstp.h" />
|
||||||
<Unit filename="rs485.c">
|
<Unit filename="rs485.c">
|
||||||
<Option compilerVar="CC" />
|
<Option compilerVar="CC" />
|
||||||
</Unit>
|
</Unit>
|
||||||
<Unit filename="rs485.h" />
|
|
||||||
<Unit filename="rx_fsm.c">
|
<Unit filename="rx_fsm.c">
|
||||||
<Option compilerVar="CC" />
|
<Option compilerVar="CC" />
|
||||||
</Unit>
|
</Unit>
|
||||||
@@ -55,6 +65,7 @@
|
|||||||
<Unit filename="stdint.h" />
|
<Unit filename="stdint.h" />
|
||||||
<Extensions>
|
<Extensions>
|
||||||
<code_completion />
|
<code_completion />
|
||||||
|
<envvars />
|
||||||
</Extensions>
|
</Extensions>
|
||||||
</Project>
|
</Project>
|
||||||
</CodeBlocks_project_file>
|
</CodeBlocks_project_file>
|
||||||
|
|||||||
Reference in New Issue
Block a user