diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-07-21 14:56:21 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-07-21 14:56:21 +0000 |
commit | fcfd6c4d7ca3cc8d2751652a79a08d64eb8ec5a3 (patch) | |
tree | a06bbe9986c21dae6763e584c9ab79394cb3b99b /apps/modbus/functions | |
parent | 1dc0e8b8c5b6e03fcfcdcbc89efd512f934eaca5 (diff) | |
download | nuttx-fcfd6c4d7ca3cc8d2751652a79a08d64eb8ec5a3.tar.gz nuttx-fcfd6c4d7ca3cc8d2751652a79a08d64eb8ec5a3.tar.bz2 nuttx-fcfd6c4d7ca3cc8d2751652a79a08d64eb8ec5a3.zip |
FreeModBus is now integrated with the Nuttx configuration system
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4961 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/modbus/functions')
-rw-r--r-- | apps/modbus/functions/mbfunccoils.c | 12 | ||||
-rw-r--r-- | apps/modbus/functions/mbfuncdisc.c | 10 | ||||
-rw-r--r-- | apps/modbus/functions/mbfuncholding.c | 14 | ||||
-rw-r--r-- | apps/modbus/functions/mbfuncinput.c | 8 | ||||
-rw-r--r-- | apps/modbus/functions/mbfuncother.c | 12 | ||||
-rw-r--r-- | apps/modbus/functions/mbutils.c | 5 |
6 files changed, 30 insertions, 31 deletions
diff --git a/apps/modbus/functions/mbfunccoils.c b/apps/modbus/functions/mbfunccoils.c index 54227b335..4bf9ce1ce 100644 --- a/apps/modbus/functions/mbfunccoils.c +++ b/apps/modbus/functions/mbfunccoils.c @@ -29,8 +29,9 @@ */ /* ----------------------- System includes ----------------------------------*/ -#include "stdlib.h" -#include "string.h" +#include <nuttx/config.h> +#include <stdlib.h> +#include <string.h> /* ----------------------- Platform includes --------------------------------*/ #include "port.h" @@ -39,7 +40,6 @@ #include "mb.h" #include "mbframe.h" #include "mbproto.h" -#include "mbconfig.h" /* ----------------------- Defines ------------------------------------------*/ #define MB_PDU_FUNC_READ_ADDR_OFF ( MB_PDU_DATA_OFF ) @@ -63,7 +63,7 @@ eMBException prveMBError2Exception( eMBErrorCode eErrorCode ); /* ----------------------- Start implementation -----------------------------*/ -#if MB_FUNC_READ_COILS_ENABLED > 0 +#ifdef CONFIG_MB_FUNC_READ_COILS_ENABLED eMBException eMBFuncReadCoils( UCHAR * pucFrame, USHORT * usLen ) @@ -143,7 +143,7 @@ eMBFuncReadCoils( UCHAR * pucFrame, USHORT * usLen ) return eStatus; } -#if MB_FUNC_WRITE_COIL_ENABLED > 0 +#ifdef CONFIG_MB_FUNC_WRITE_COIL_ENABLED eMBException eMBFuncWriteCoil( UCHAR * pucFrame, USHORT * usLen ) { @@ -197,7 +197,7 @@ eMBFuncWriteCoil( UCHAR * pucFrame, USHORT * usLen ) #endif -#if MB_FUNC_WRITE_MULTIPLE_COILS_ENABLED > 0 +#ifdef CONFIG_MB_FUNC_WRITE_MULTIPLE_COILS_ENABLED eMBException eMBFuncWriteMultipleCoils( UCHAR * pucFrame, USHORT * usLen ) { diff --git a/apps/modbus/functions/mbfuncdisc.c b/apps/modbus/functions/mbfuncdisc.c index fb378441b..14d49e470 100644 --- a/apps/modbus/functions/mbfuncdisc.c +++ b/apps/modbus/functions/mbfuncdisc.c @@ -17,11 +17,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - - /* ----------------------- System includes ----------------------------------*/ -#include "stdlib.h" -#include "string.h" +#include <nuttx/config.h> +#include <stdlib.h> +#include <string.h> /* ----------------------- Platform includes --------------------------------*/ #include "port.h" @@ -30,7 +29,6 @@ #include "mb.h" #include "mbframe.h" #include "mbproto.h" -#include "mbconfig.h" /* ----------------------- Defines ------------------------------------------*/ #define MB_PDU_FUNC_READ_ADDR_OFF ( MB_PDU_DATA_OFF ) @@ -43,7 +41,7 @@ eMBException prveMBError2Exception( eMBErrorCode eErrorCode ); /* ----------------------- Start implementation -----------------------------*/ -#if MB_FUNC_READ_COILS_ENABLED > 0 +#ifdef CONFIG_MB_FUNC_READ_COILS_ENABLED eMBException eMBFuncReadDiscreteInputs( UCHAR * pucFrame, USHORT * usLen ) diff --git a/apps/modbus/functions/mbfuncholding.c b/apps/modbus/functions/mbfuncholding.c index e74a0624d..507b7f382 100644 --- a/apps/modbus/functions/mbfuncholding.c +++ b/apps/modbus/functions/mbfuncholding.c @@ -29,8 +29,9 @@ */ /* ----------------------- System includes ----------------------------------*/ -#include "stdlib.h" -#include "string.h" +#include <nuttx/config.h> +#include <stdlib.h> +#include <string.h> /* ----------------------- Platform includes --------------------------------*/ #include "port.h" @@ -39,7 +40,6 @@ #include "mb.h" #include "mbframe.h" #include "mbproto.h" -#include "mbconfig.h" /* ----------------------- Defines ------------------------------------------*/ #define MB_PDU_FUNC_READ_ADDR_OFF ( MB_PDU_DATA_OFF + 0) @@ -71,7 +71,7 @@ eMBException prveMBError2Exception( eMBErrorCode eErrorCode ); /* ----------------------- Start implementation -----------------------------*/ -#if MB_FUNC_WRITE_HOLDING_ENABLED > 0 +#ifdef CONFIG_MB_FUNC_WRITE_HOLDING_ENABLED eMBException eMBFuncWriteHoldingRegister( UCHAR * pucFrame, USHORT * usLen ) @@ -105,7 +105,7 @@ eMBFuncWriteHoldingRegister( UCHAR * pucFrame, USHORT * usLen ) } #endif -#if MB_FUNC_WRITE_MULTIPLE_HOLDING_ENABLED > 0 +#ifdef CONFIG_MB_FUNC_WRITE_MULTIPLE_HOLDING_ENABLED eMBException eMBFuncWriteMultipleHoldingRegister( UCHAR * pucFrame, USHORT * usLen ) { @@ -164,7 +164,7 @@ eMBFuncWriteMultipleHoldingRegister( UCHAR * pucFrame, USHORT * usLen ) } #endif -#if MB_FUNC_READ_HOLDING_ENABLED > 0 +#ifdef CONFIG_MB_FUNC_READ_HOLDING_ENABLED eMBException eMBFuncReadHoldingRegister( UCHAR * pucFrame, USHORT * usLen ) @@ -229,7 +229,7 @@ eMBFuncReadHoldingRegister( UCHAR * pucFrame, USHORT * usLen ) #endif -#if MB_FUNC_READWRITE_HOLDING_ENABLED > 0 +#ifdef CONFIG_MB_FUNC_READWRITE_HOLDING_ENABLED eMBException eMBFuncReadWriteMultipleHoldingRegister( UCHAR * pucFrame, USHORT * usLen ) diff --git a/apps/modbus/functions/mbfuncinput.c b/apps/modbus/functions/mbfuncinput.c index cceedbafe..92c3ab79f 100644 --- a/apps/modbus/functions/mbfuncinput.c +++ b/apps/modbus/functions/mbfuncinput.c @@ -29,8 +29,9 @@ */ /* ----------------------- System includes ----------------------------------*/ -#include "stdlib.h" -#include "string.h" +#include <nuttx/config.h> +#include <stdlib.h> +#include <string.h> /* ----------------------- Platform includes --------------------------------*/ #include "port.h" @@ -39,7 +40,6 @@ #include "mb.h" #include "mbframe.h" #include "mbproto.h" -#include "mbconfig.h" /* ----------------------- Defines ------------------------------------------*/ #define MB_PDU_FUNC_READ_ADDR_OFF ( MB_PDU_DATA_OFF ) @@ -53,8 +53,8 @@ eMBException prveMBError2Exception( eMBErrorCode eErrorCode ); /* ----------------------- Start implementation -----------------------------*/ -#if MB_FUNC_READ_INPUT_ENABLED > 0 +#ifdef CONFIG_MB_FUNC_READ_INPUT_ENABLED eMBException eMBFuncReadInputRegister( UCHAR * pucFrame, USHORT * usLen ) { diff --git a/apps/modbus/functions/mbfuncother.c b/apps/modbus/functions/mbfuncother.c index fcee972bf..5d5636a16 100644 --- a/apps/modbus/functions/mbfuncother.c +++ b/apps/modbus/functions/mbfuncother.c @@ -29,8 +29,9 @@ */ /* ----------------------- System includes ----------------------------------*/ -#include "stdlib.h" -#include "string.h" +#include <nuttx/config.h> +#include <stdlib.h> +#include <string.h> /* ----------------------- Platform includes --------------------------------*/ #include "port.h" @@ -39,12 +40,11 @@ #include "mb.h" #include "mbframe.h" #include "mbproto.h" -#include "mbconfig.h" -#if MB_FUNC_OTHER_REP_SLAVEID_ENABLED > 0 +#ifdef CONFIG_MB_FUNC_OTHER_REP_SLAVEID_ENABLED /* ----------------------- Static variables ---------------------------------*/ -static UCHAR ucMBSlaveID[MB_FUNC_OTHER_REP_SLAVEID_BUF]; +static UCHAR ucMBSlaveID[CONFIG_MB_FUNC_OTHER_REP_SLAVEID_BUF]; static USHORT usMBSlaveIDLen; /* ----------------------- Start implementation -----------------------------*/ @@ -58,7 +58,7 @@ eMBSetSlaveID( UCHAR ucSlaveID, BOOL xIsRunning, /* the first byte and second byte in the buffer is reserved for * the parameter ucSlaveID and the running flag. The rest of * the buffer is available for additional data. */ - if( usAdditionalLen + 2 < MB_FUNC_OTHER_REP_SLAVEID_BUF ) + if( usAdditionalLen + 2 < CONFIG_MB_FUNC_OTHER_REP_SLAVEID_BUF ) { usMBSlaveIDLen = 0; ucMBSlaveID[usMBSlaveIDLen++] = ucSlaveID; diff --git a/apps/modbus/functions/mbutils.c b/apps/modbus/functions/mbutils.c index 6a725703e..8812419ec 100644 --- a/apps/modbus/functions/mbutils.c +++ b/apps/modbus/functions/mbutils.c @@ -29,8 +29,9 @@ */ /* ----------------------- System includes ----------------------------------*/ -#include "stdlib.h" -#include "string.h" +#include <nuttx/config.h> +#include <stdlib.h> +#include <string.h> /* ----------------------- Platform includes --------------------------------*/ #include "port.h" |