summaryrefslogtreecommitdiff
path: root/apps/modbus
diff options
context:
space:
mode:
Diffstat (limited to 'apps/modbus')
-rw-r--r--apps/modbus/Kconfig2
-rw-r--r--apps/modbus/Makefile2
-rw-r--r--apps/modbus/ascii/mbascii.c4
-rw-r--r--apps/modbus/ascii/mbascii.h2
-rw-r--r--apps/modbus/functions/mbfunccoils.c8
-rw-r--r--apps/modbus/functions/mbfuncdiag.c2
-rw-r--r--apps/modbus/functions/mbfuncdisc.c4
-rw-r--r--apps/modbus/functions/mbfuncholding.c4
-rw-r--r--apps/modbus/functions/mbfuncinput.c4
-rw-r--r--apps/modbus/functions/mbfuncother.c2
-rw-r--r--apps/modbus/functions/mbutils.c2
-rw-r--r--apps/modbus/mb.c4
-rw-r--r--apps/modbus/nuttx/portserial.c2
-rw-r--r--apps/modbus/rtu/mbcrc.c12
-rw-r--r--apps/modbus/rtu/mbcrc.h2
-rw-r--r--apps/modbus/rtu/mbrtu.c2
-rw-r--r--apps/modbus/rtu/mbrtu.h2
-rw-r--r--apps/modbus/tcp/mbtcp.c14
-rw-r--r--apps/modbus/tcp/mbtcp.h2
19 files changed, 38 insertions, 38 deletions
diff --git a/apps/modbus/Kconfig b/apps/modbus/Kconfig
index a4194e475..51d3c0c3e 100644
--- a/apps/modbus/Kconfig
+++ b/apps/modbus/Kconfig
@@ -44,7 +44,7 @@ config MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS
MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS to allow for a delay before
the serial transmitter is enabled. This is required because some
targets are so fast that there is no time between receiving and
- transmitting the frame. If the master is to slow with enabling its
+ transmitting the frame. If the master is to slow with enabling its
receiver then he will not receive the response correctly.
config MB_FUNC_HANDLERS_MAX
diff --git a/apps/modbus/Makefile b/apps/modbus/Makefile
index 27548f3d6..49d47abcd 100644
--- a/apps/modbus/Makefile
+++ b/apps/modbus/Makefile
@@ -114,6 +114,6 @@ distclean: clean
$(call DELFILE, Make.dep)
$(call DELFILE, .depend)
-
+
-include Make.dep
diff --git a/apps/modbus/ascii/mbascii.c b/apps/modbus/ascii/mbascii.c
index 4b8a56e01..57ea368a7 100644
--- a/apps/modbus/ascii/mbascii.c
+++ b/apps/modbus/ascii/mbascii.c
@@ -1,4 +1,4 @@
-/*
+/*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved.
@@ -110,7 +110,7 @@ eMBASCIIInit( uint8_t ucSlaveAddress, uint8_t ucPort, speed_t ulBaudRate, eMBPar
{
eMBErrorCode eStatus = MB_ENOERR;
( void )ucSlaveAddress;
-
+
ENTER_CRITICAL_SECTION( );
ucMBLFCharacter = MB_ASCII_DEFAULT_LF;
diff --git a/apps/modbus/ascii/mbascii.h b/apps/modbus/ascii/mbascii.h
index 96001404a..983383d03 100644
--- a/apps/modbus/ascii/mbascii.h
+++ b/apps/modbus/ascii/mbascii.h
@@ -1,4 +1,4 @@
-/*
+/*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved.
diff --git a/apps/modbus/functions/mbfunccoils.c b/apps/modbus/functions/mbfunccoils.c
index d5f23c855..d6e539779 100644
--- a/apps/modbus/functions/mbfunccoils.c
+++ b/apps/modbus/functions/mbfunccoils.c
@@ -1,4 +1,4 @@
-/*
+/*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved.
@@ -86,7 +86,7 @@ eMBFuncReadCoils( uint8_t * pucFrame, uint16_t * usLen )
usCoilCount |= ( uint16_t )( pucFrame[MB_PDU_FUNC_READ_COILCNT_OFF + 1] );
/* Check if the number of registers to read is valid. If not
- * return Modbus illegal data value exception.
+ * return Modbus illegal data value exception.
*/
if( ( usCoilCount >= 1 ) &&
( usCoilCount < MB_PDU_FUNC_READ_COILCNT_MAX ) )
@@ -124,7 +124,7 @@ eMBFuncReadCoils( uint8_t * pucFrame, uint16_t * usLen )
else
{
/* The response contains the function code, the starting address
- * and the quantity of registers. We reuse the old values in the
+ * and the quantity of registers. We reuse the old values in the
* buffer because they are still valid. */
*usLen += ucNBytes;;
}
@@ -246,7 +246,7 @@ eMBFuncWriteMultipleCoils( uint8_t * pucFrame, uint16_t * usLen )
else
{
/* The response contains the function code, the starting address
- * and the quantity of registers. We reuse the old values in the
+ * and the quantity of registers. We reuse the old values in the
* buffer because they are still valid. */
*usLen = MB_PDU_FUNC_WRITE_MUL_BYTECNT_OFF;
}
diff --git a/apps/modbus/functions/mbfuncdiag.c b/apps/modbus/functions/mbfuncdiag.c
index d75ffc0f7..8f7b9675b 100644
--- a/apps/modbus/functions/mbfuncdiag.c
+++ b/apps/modbus/functions/mbfuncdiag.c
@@ -1,4 +1,4 @@
-/*
+/*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved.
diff --git a/apps/modbus/functions/mbfuncdisc.c b/apps/modbus/functions/mbfuncdisc.c
index 6f291bf2f..46204d3ce 100644
--- a/apps/modbus/functions/mbfuncdisc.c
+++ b/apps/modbus/functions/mbfuncdisc.c
@@ -64,7 +64,7 @@ eMBFuncReadDiscreteInputs( uint8_t * pucFrame, uint16_t * usLen )
usDiscreteCnt |= ( uint16_t )( pucFrame[MB_PDU_FUNC_READ_DISCCNT_OFF + 1] );
/* Check if the number of registers to read is valid. If not
- * return Modbus illegal data value exception.
+ * return Modbus illegal data value exception.
*/
if( ( usDiscreteCnt >= 1 ) &&
( usDiscreteCnt < MB_PDU_FUNC_READ_DISCCNT_MAX ) )
@@ -101,7 +101,7 @@ eMBFuncReadDiscreteInputs( uint8_t * pucFrame, uint16_t * usLen )
else
{
/* The response contains the function code, the starting address
- * and the quantity of registers. We reuse the old values in the
+ * and the quantity of registers. We reuse the old values in the
* buffer because they are still valid. */
*usLen += ucNBytes;;
}
diff --git a/apps/modbus/functions/mbfuncholding.c b/apps/modbus/functions/mbfuncholding.c
index 885ce34ca..7e0dee86b 100644
--- a/apps/modbus/functions/mbfuncholding.c
+++ b/apps/modbus/functions/mbfuncholding.c
@@ -1,4 +1,4 @@
-/*
+/*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved.
@@ -186,7 +186,7 @@ eMBFuncReadHoldingRegister( uint8_t * pucFrame, uint16_t * usLen )
usRegCount = ( uint16_t )( pucFrame[MB_PDU_FUNC_READ_REGCNT_OFF + 1] );
/* Check if the number of registers to read is valid. If not
- * return Modbus illegal data value exception.
+ * return Modbus illegal data value exception.
*/
if( ( usRegCount >= 1 ) && ( usRegCount <= MB_PDU_FUNC_READ_REGCNT_MAX ) )
{
diff --git a/apps/modbus/functions/mbfuncinput.c b/apps/modbus/functions/mbfuncinput.c
index 3061340f6..6c87e699a 100644
--- a/apps/modbus/functions/mbfuncinput.c
+++ b/apps/modbus/functions/mbfuncinput.c
@@ -1,4 +1,4 @@
-/*
+/*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved.
@@ -75,7 +75,7 @@ eMBFuncReadInputRegister( uint8_t * pucFrame, uint16_t * usLen )
usRegCount |= ( uint16_t )( pucFrame[MB_PDU_FUNC_READ_REGCNT_OFF + 1] );
/* Check if the number of registers to read is valid. If not
- * return Modbus illegal data value exception.
+ * return Modbus illegal data value exception.
*/
if( ( usRegCount >= 1 )
&& ( usRegCount < MB_PDU_FUNC_READ_REGCNT_MAX ) )
diff --git a/apps/modbus/functions/mbfuncother.c b/apps/modbus/functions/mbfuncother.c
index ea733e905..1082fda50 100644
--- a/apps/modbus/functions/mbfuncother.c
+++ b/apps/modbus/functions/mbfuncother.c
@@ -1,4 +1,4 @@
-/*
+/*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved.
diff --git a/apps/modbus/functions/mbutils.c b/apps/modbus/functions/mbutils.c
index cbe02872b..305abb17a 100644
--- a/apps/modbus/functions/mbutils.c
+++ b/apps/modbus/functions/mbutils.c
@@ -1,4 +1,4 @@
-/*
+/*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved.
diff --git a/apps/modbus/mb.c b/apps/modbus/mb.c
index 54e96460d..a86ce343f 100644
--- a/apps/modbus/mb.c
+++ b/apps/modbus/mb.c
@@ -1,4 +1,4 @@
-/*
+/*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved.
@@ -160,7 +160,7 @@ eMBInit( eMBMode eMode, uint8_t ucSlaveAddress, uint8_t ucPort, speed_t ulBaudRa
eStatus = eMBRTUInit( ucMBAddress, ucPort, ulBaudRate, eParity );
break;
#endif
-#ifdef CONFIG_MB_ASCII_ENABLED
+#ifdef CONFIG_MB_ASCII_ENABLED
case MB_ASCII:
pvMBFrameStartCur = eMBASCIIStart;
pvMBFrameStopCur = eMBASCIIStop;
diff --git a/apps/modbus/nuttx/portserial.c b/apps/modbus/nuttx/portserial.c
index 68c02830a..fdeb9bc6b 100644
--- a/apps/modbus/nuttx/portserial.c
+++ b/apps/modbus/nuttx/portserial.c
@@ -174,7 +174,7 @@ bool xMBPortSerialInit(uint8_t ucPort, speed_t ulBaudRate,
* cfsetospeed(), and
* (3) In NuttX, the input value to cfiset[i|o]speed is not
* encoded, but is the absolute baud value. The following might
- * not be
+ * not be
*/
if (cfsetispeed(&xNewTIO, ulBaudRate) != 0 /* || cfsetospeed(&xNewTIO, ulBaudRate) != 0 */)
diff --git a/apps/modbus/rtu/mbcrc.c b/apps/modbus/rtu/mbcrc.c
index 82fe3c3fb..3b34edd77 100644
--- a/apps/modbus/rtu/mbcrc.c
+++ b/apps/modbus/rtu/mbcrc.c
@@ -1,4 +1,4 @@
-/*
+/*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved.
@@ -43,12 +43,12 @@ static const uint8_t aucCRCHi[] = {
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
- 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
+ 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
- 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
+ 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
- 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
+ 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x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x77, 0xB7, 0xB6, 0x76, 0x72, 0xB2, 0xB3, 0x73, 0xB1, 0x71, 0x70, 0xB0,
diff --git a/apps/modbus/rtu/mbcrc.h b/apps/modbus/rtu/mbcrc.h
index 9ff06e25d..abde43f2c 100644
--- a/apps/modbus/rtu/mbcrc.h
+++ b/apps/modbus/rtu/mbcrc.h
@@ -1,4 +1,4 @@
-/*
+/*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved.
diff --git a/apps/modbus/rtu/mbrtu.c b/apps/modbus/rtu/mbrtu.c
index 196473c17..ee4f95fca 100644
--- a/apps/modbus/rtu/mbrtu.c
+++ b/apps/modbus/rtu/mbrtu.c
@@ -1,4 +1,4 @@
-/*
+/*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved.
diff --git a/apps/modbus/rtu/mbrtu.h b/apps/modbus/rtu/mbrtu.h
index ca35b94a7..bea5d1eeb 100644
--- a/apps/modbus/rtu/mbrtu.h
+++ b/apps/modbus/rtu/mbrtu.h
@@ -1,4 +1,4 @@
-/*
+/*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved.
diff --git a/apps/modbus/tcp/mbtcp.c b/apps/modbus/tcp/mbtcp.c
index b841f078a..7a8f5095f 100644
--- a/apps/modbus/tcp/mbtcp.c
+++ b/apps/modbus/tcp/mbtcp.c
@@ -1,4 +1,4 @@
-/*
+/*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved.
@@ -55,10 +55,10 @@
* +-----------+---------------+------------------------------------------+
* | TID | PID | Length | UID |Code | Data |
* +-----------+---------------+------------------------------------------+
- * | | | | |
- * (2) (3) (4) (5) (6)
+ * | | | | |
+ * (2) (3) (4) (5) (6)
*
- * (2) ... MB_TCP_TID = 0 (Transaction Identifier - 2 Byte)
+ * (2) ... MB_TCP_TID = 0 (Transaction Identifier - 2 Byte)
* (3) ... MB_TCP_PID = 2 (Protocol Identifier - 2 Byte)
* (4) ... MB_TCP_LEN = 4 (Number of bytes - 2 Byte)
* (5) ... MB_TCP_UID = 6 (Unit Identifier - 1 Byte)
@@ -142,9 +142,9 @@ eMBTCPSend( uint8_t _unused, const uint8_t * pucFrame, uint16_t usLength )
uint16_t usTCPLength = usLength + MB_TCP_FUNC;
/* The MBAP header is already initialized because the caller calls this
- * function with the buffer returned by the previous call. Therefore we
- * only have to update the length in the header. Note that the length
- * header includes the size of the Modbus PDU and the UID Byte. Therefore
+ * function with the buffer returned by the previous call. Therefore we
+ * only have to update the length in the header. Note that the length
+ * header includes the size of the Modbus PDU and the UID Byte. Therefore
* the length is usLength plus one.
*/
pucMBTCPFrame[MB_TCP_LEN] = ( usLength + 1 ) >> 8U;
diff --git a/apps/modbus/tcp/mbtcp.h b/apps/modbus/tcp/mbtcp.h
index 1ded9c5d4..f00152810 100644
--- a/apps/modbus/tcp/mbtcp.h
+++ b/apps/modbus/tcp/mbtcp.h
@@ -1,4 +1,4 @@
-/*
+/*
* FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
* Copyright (c) 2006 Christian Walter <wolti@sil.at>
* All rights reserved.