diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-07-21 16:18:16 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-07-21 16:18:16 +0000 |
commit | ebf70f8a79eb8ef23bc1d99938768ef06c466119 (patch) | |
tree | b6b1ed94e450700269e6113516f911b4fd7a3848 /apps/modbus/ascii | |
parent | 814d1451322bba23a1be8ffb07dc00773613c503 (diff) | |
download | px4-nuttx-ebf70f8a79eb8ef23bc1d99938768ef06c466119.tar.gz px4-nuttx-ebf70f8a79eb8ef23bc1d99938768ef06c466119.tar.bz2 px4-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/ascii')
-rw-r--r-- | apps/modbus/ascii/Make.defs | 2 | ||||
-rw-r--r-- | apps/modbus/ascii/mbascii.c | 19 |
2 files changed, 11 insertions, 10 deletions
diff --git a/apps/modbus/ascii/Make.defs b/apps/modbus/ascii/Make.defs index 263134f1c..3e9967283 100644 --- a/apps/modbus/ascii/Make.defs +++ b/apps/modbus/ascii/Make.defs @@ -33,7 +33,7 @@ # ############################################################################ -ifeq ($(MB_ASCII_ENABLED),y) +ifeq ($(CONFIG_MB_ASCII_ENABLED),y) CSRCS += mbascii.c diff --git a/apps/modbus/ascii/mbascii.c b/apps/modbus/ascii/mbascii.c index c334d6a9a..6b871601b 100644 --- a/apps/modbus/ascii/mbascii.c +++ b/apps/modbus/ascii/mbascii.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 "mbascii.h" -#include "mbframe.h" +#include <apps/modbus/mb.h> +#include <apps/modbus/mbframe.h> +#include <apps/modbus/mbport.h> +#include "mbascii.h" #include "mbcrc.h" -#include "mbport.h" #ifdef CONFIG_MB_ASCII_ENABLED @@ -154,7 +155,7 @@ eMBASCIIReceive( 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 ) @@ -225,7 +226,7 @@ xMBASCIIReceiveFSM( void ) UCHAR ucByte; UCHAR ucResult; - assert( eSndState == STATE_TX_IDLE ); + ASSERT( eSndState == STATE_TX_IDLE ); ( void )xMBPortSerialGetByte( ( CHAR * ) & ucByte ); switch ( eRcvState ) @@ -333,7 +334,7 @@ xMBASCIITransmitFSM( void ) BOOL xNeedPoll = FALSE; UCHAR ucByte; - assert( eRcvState == STATE_RX_IDLE ); + ASSERT( eRcvState == STATE_RX_IDLE ); switch ( eSndState ) { /* Start of transmission. The start of a frame is defined by sending @@ -421,7 +422,7 @@ xMBASCIITimerT1SExpired( void ) break; default: - assert( ( eRcvState == STATE_RX_RCV ) || ( eRcvState == STATE_RX_WAIT_EOF ) ); + ASSERT( ( eRcvState == STATE_RX_RCV ) || ( eRcvState == STATE_RX_WAIT_EOF ) ); break; } vMBPortTimersDisable( ); @@ -462,7 +463,7 @@ prvucMBBIN2CHAR( UCHAR ucByte ) else { /* Programming error. */ - assert( 0 ); + ASSERT( 0 ); } return '0'; } |