summaryrefslogtreecommitdiff
path: root/apps/modbus/functions/mbfuncother.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-07-21 21:23:18 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-07-21 21:23:18 +0000
commitd9714b556703561a0abcbe71970b1cd6922168a6 (patch)
tree70b7893243b8ee2e6b8b5fd95106c4ab962699c5 /apps/modbus/functions/mbfuncother.c
parentebf70f8a79eb8ef23bc1d99938768ef06c466119 (diff)
downloadnuttx-d9714b556703561a0abcbe71970b1cd6922168a6.tar.gz
nuttx-d9714b556703561a0abcbe71970b1cd6922168a6.tar.bz2
nuttx-d9714b556703561a0abcbe71970b1cd6922168a6.zip
Use NuttX types in FreeModBus port; Add FreeModBus demo at apps/examples/modbus; Add new termios APIs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4964 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/modbus/functions/mbfuncother.c')
-rw-r--r--apps/modbus/functions/mbfuncother.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/modbus/functions/mbfuncother.c b/apps/modbus/functions/mbfuncother.c
index f68097a4c..ea733e905 100644
--- a/apps/modbus/functions/mbfuncother.c
+++ b/apps/modbus/functions/mbfuncother.c
@@ -44,14 +44,14 @@
#ifdef CONFIG_MB_FUNC_OTHER_REP_SLAVEID_ENABLED
/* ----------------------- Static variables ---------------------------------*/
-static UCHAR ucMBSlaveID[CONFIG_MB_FUNC_OTHER_REP_SLAVEID_BUF];
-static USHORT usMBSlaveIDLen;
+static uint8_t ucMBSlaveID[CONFIG_MB_FUNC_OTHER_REP_SLAVEID_BUF];
+static uint16_t usMBSlaveIDLen;
/* ----------------------- Start implementation -----------------------------*/
eMBErrorCode
-eMBSetSlaveID( UCHAR ucSlaveID, BOOL xIsRunning,
- UCHAR const *pucAdditional, USHORT usAdditionalLen )
+eMBSetSlaveID( uint8_t ucSlaveID, bool xIsRunning,
+ uint8_t const *pucAdditional, uint16_t usAdditionalLen )
{
eMBErrorCode eStatus = MB_ENOERR;
@@ -62,7 +62,7 @@ eMBSetSlaveID( UCHAR ucSlaveID, BOOL xIsRunning,
{
usMBSlaveIDLen = 0;
ucMBSlaveID[usMBSlaveIDLen++] = ucSlaveID;
- ucMBSlaveID[usMBSlaveIDLen++] = ( UCHAR )( xIsRunning ? 0xFF : 0x00 );
+ ucMBSlaveID[usMBSlaveIDLen++] = ( uint8_t )( xIsRunning ? 0xFF : 0x00 );
if( usAdditionalLen > 0 )
{
memcpy( &ucMBSlaveID[usMBSlaveIDLen], pucAdditional,
@@ -78,10 +78,10 @@ eMBSetSlaveID( UCHAR ucSlaveID, BOOL xIsRunning,
}
eMBException
-eMBFuncReportSlaveID( UCHAR * pucFrame, USHORT * usLen )
+eMBFuncReportSlaveID( uint8_t * pucFrame, uint16_t * usLen )
{
memcpy( &pucFrame[MB_PDU_DATA_OFF], &ucMBSlaveID[0], ( size_t )usMBSlaveIDLen );
- *usLen = ( USHORT )( MB_PDU_DATA_OFF + usMBSlaveIDLen );
+ *usLen = ( uint16_t )( MB_PDU_DATA_OFF + usMBSlaveIDLen );
return MB_EX_NONE;
}