summaryrefslogtreecommitdiff
path: root/apps/modbus/rtu
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-07-21 16:18:16 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-07-21 16:18:16 +0000
commitebf70f8a79eb8ef23bc1d99938768ef06c466119 (patch)
treeb6b1ed94e450700269e6113516f911b4fd7a3848 /apps/modbus/rtu
parent814d1451322bba23a1be8ffb07dc00773613c503 (diff)
downloadnuttx-ebf70f8a79eb8ef23bc1d99938768ef06c466119.tar.gz
nuttx-ebf70f8a79eb8ef23bc1d99938768ef06c466119.tar.bz2
nuttx-ebf70f8a79eb8ef23bc1d99938768ef06c466119.zip
FreeModBus now builds
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4963 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/modbus/rtu')
-rw-r--r--apps/modbus/rtu/Make.defs2
-rw-r--r--apps/modbus/rtu/mbrtu.c17
2 files changed, 10 insertions, 9 deletions
diff --git a/apps/modbus/rtu/Make.defs b/apps/modbus/rtu/Make.defs
index bb1b46c30..8b9c68c77 100644
--- a/apps/modbus/rtu/Make.defs
+++ b/apps/modbus/rtu/Make.defs
@@ -33,7 +33,7 @@
#
############################################################################
-ifeq ($(MB_RTU_ENABLED),y)
+ifeq ($(CONFIG_MB_RTU_ENABLED),y)
CSRCS += mbcrc.c mbrtu.c
diff --git a/apps/modbus/rtu/mbrtu.c b/apps/modbus/rtu/mbrtu.c
index d3fd01fcb..8959b66f7 100644
--- a/apps/modbus/rtu/mbrtu.c
+++ b/apps/modbus/rtu/mbrtu.c
@@ -32,17 +32,18 @@
#include <nuttx/config.h>
#include <stdlib.h>
#include <string.h>
+#include <assert.h>
/* ----------------------- Platform includes --------------------------------*/
#include "port.h"
/* ----------------------- Modbus includes ----------------------------------*/
-#include "mb.h"
-#include "mbrtu.h"
-#include "mbframe.h"
+#include <apps/modbus/mb.h>
+#include <apps/modbus/mbframe.h>
+#include <apps/modbus/mbport.h>
+#include "mbrtu.h"
#include "mbcrc.h"
-#include "mbport.h"
/* ----------------------- Defines ------------------------------------------*/
#define MB_SER_PDU_SIZE_MIN 4 /*!< Minimum size of a Modbus RTU frame. */
@@ -155,7 +156,7 @@ eMBRTUReceive( UCHAR * pucRcvAddress, UCHAR ** pucFrame, USHORT * pusLength )
eMBErrorCode eStatus = MB_ENOERR;
ENTER_CRITICAL_SECTION( );
- assert( usRcvBufferPos < MB_SER_PDU_SIZE_MAX );
+ ASSERT( usRcvBufferPos < MB_SER_PDU_SIZE_MAX );
/* Length and CRC check */
if( ( usRcvBufferPos >= MB_SER_PDU_SIZE_MIN )
@@ -229,7 +230,7 @@ xMBRTUReceiveFSM( void )
BOOL xTaskNeedSwitch = FALSE;
UCHAR ucByte;
- assert( eSndState == STATE_TX_IDLE );
+ ASSERT( eSndState == STATE_TX_IDLE );
/* Always read the character. */
( void )xMBPortSerialGetByte( ( CHAR * ) & ucByte );
@@ -288,7 +289,7 @@ xMBRTUTransmitFSM( void )
{
BOOL xNeedPoll = FALSE;
- assert( eRcvState == STATE_RX_IDLE );
+ ASSERT( eRcvState == STATE_RX_IDLE );
switch ( eSndState )
{
@@ -345,7 +346,7 @@ xMBRTUTimerT35Expired( void )
/* Function called in an illegal state. */
default:
- assert( ( eRcvState == STATE_RX_INIT ) ||
+ ASSERT( ( eRcvState == STATE_RX_INIT ) ||
( eRcvState == STATE_RX_RCV ) || ( eRcvState == STATE_RX_ERROR ) );
}