summaryrefslogtreecommitdiff
path: root/apps/modbus/mb.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/modbus/mb.c')
-rw-r--r--apps/modbus/mb.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/apps/modbus/mb.c b/apps/modbus/mb.c
index 421a25567..0e5c8a920 100644
--- a/apps/modbus/mb.c
+++ b/apps/modbus/mb.c
@@ -62,7 +62,7 @@
/* ----------------------- Static variables ---------------------------------*/
-static UCHAR ucMBAddress;
+static uint8_t ucMBAddress;
static eMBMode eMBCurrentMode;
static enum
@@ -85,12 +85,12 @@ static pvMBFrameClose pvMBFrameCloseCur;
* an external event has happend which includes a timeout or the reception
* or transmission of a character.
*/
-BOOL( *pxMBFrameCBByteReceived ) ( void );
-BOOL( *pxMBFrameCBTransmitterEmpty ) ( void );
-BOOL( *pxMBPortCBTimerExpired ) ( void );
+bool( *pxMBFrameCBByteReceived ) ( void );
+bool( *pxMBFrameCBTransmitterEmpty ) ( void );
+bool( *pxMBPortCBTimerExpired ) ( void );
-BOOL( *pxMBFrameCBReceiveFSMCur ) ( void );
-BOOL( *pxMBFrameCBTransmitFSMCur ) ( void );
+bool( *pxMBFrameCBReceiveFSMCur ) ( void );
+bool( *pxMBFrameCBTransmitFSMCur ) ( void );
/* An array of Modbus functions handlers which associates Modbus function
* codes with implementing functions.
@@ -130,7 +130,7 @@ static xMBFunctionHandler xFuncHandlers[CONFIG_MB_FUNC_HANDLERS_MAX] = {
/* ----------------------- Start implementation -----------------------------*/
eMBErrorCode
-eMBInit( eMBMode eMode, UCHAR ucSlaveAddress, UCHAR ucPort, ULONG ulBaudRate, eMBParity eParity )
+eMBInit( eMBMode eMode, uint8_t ucSlaveAddress, uint8_t ucPort, uint32_t ulBaudRate, eMBParity eParity )
{
eMBErrorCode eStatus = MB_ENOERR;
@@ -197,7 +197,7 @@ eMBInit( eMBMode eMode, UCHAR ucSlaveAddress, UCHAR ucPort, ULONG ulBaudRate, eM
#ifdef CONFIG_MB_TCP_ENABLED
eMBErrorCode
-eMBTCPInit( USHORT ucTCPPort )
+eMBTCPInit( uint16_t ucTCPPort )
{
eMBErrorCode eStatus = MB_ENOERR;
@@ -226,7 +226,7 @@ eMBTCPInit( USHORT ucTCPPort )
#endif
eMBErrorCode
-eMBRegisterCB( UCHAR ucFunctionCode, pxMBFunctionHandler pxHandler )
+eMBRegisterCB( uint8_t ucFunctionCode, pxMBFunctionHandler pxHandler )
{
int i;
eMBErrorCode eStatus;
@@ -334,10 +334,10 @@ eMBDisable( void )
eMBErrorCode
eMBPoll( void )
{
- static UCHAR *ucMBFrame;
- static UCHAR ucRcvAddress;
- static UCHAR ucFunctionCode;
- static USHORT usLength;
+ static uint8_t *ucMBFrame;
+ static uint8_t ucRcvAddress;
+ static uint8_t ucFunctionCode;
+ static uint16_t usLength;
static eMBException eException;
int i;
@@ -352,7 +352,7 @@ eMBPoll( void )
/* Check if there is a event available. If not return control to caller.
* Otherwise we will handle the event. */
- if( xMBPortEventGet( &eEvent ) == TRUE )
+ if( xMBPortEventGet( &eEvent ) == true )
{
switch ( eEvent )
{
@@ -396,7 +396,7 @@ eMBPoll( void )
{
/* An exception occured. Build an error frame. */
usLength = 0;
- ucMBFrame[usLength++] = ( UCHAR )( ucFunctionCode | MB_FUNC_ERROR );
+ ucMBFrame[usLength++] = ( uint8_t )( ucFunctionCode | MB_FUNC_ERROR );
ucMBFrame[usLength++] = eException;
}
if( ( eMBCurrentMode == MB_ASCII ) && CONFIG_MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS )