summaryrefslogtreecommitdiff
path: root/components/net
diff options
context:
space:
mode:
authorarmink <[email protected]>2015-02-05 21:22:18 +0800
committerarmink <[email protected]>2015-02-05 21:22:18 +0800
commitb3290f6eede6622b395c2a09d729f50917c783ee (patch)
tree85695f7a3d3d01618948d2ef55fe8b85756c4af6 /components/net
parentdec67c3a29a79d1357d75bc518a531795be9950b (diff)
[modbus]changed tabs to spaces.
Diffstat (limited to 'components/net')
-rw-r--r--components/net/freemodbus-v1.6.0/port/port.c6
-rw-r--r--components/net/freemodbus-v1.6.0/port/port.h6
-rw-r--r--components/net/freemodbus-v1.6.0/port/portserial.c2
-rw-r--r--components/net/freemodbus-v1.6.0/port/portserial_m.c10
-rw-r--r--components/net/freemodbus-v1.6.0/port/porttimer_m.c16
-rw-r--r--components/net/freemodbus-v1.6.0/port/user_mb_app.c4
6 files changed, 22 insertions, 22 deletions
diff --git a/components/net/freemodbus-v1.6.0/port/port.c b/components/net/freemodbus-v1.6.0/port/port.c
index 527af909ac..d01c5c9d6a 100644
--- a/components/net/freemodbus-v1.6.0/port/port.c
+++ b/components/net/freemodbus-v1.6.0/port/port.c
@@ -16,7 +16,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
- * File: $Id: portevent.c,v 1.60 2015/02/01 9:18:05 Armink $
+ * File: $Id: port.c,v 1.60 2015/02/01 9:18:05 Armink $
*/
/* ----------------------- System includes --------------------------------*/
@@ -28,11 +28,11 @@ static rt_base_t level;
/* ----------------------- Start implementation -----------------------------*/
void EnterCriticalSection(void)
{
- level = rt_hw_interrupt_disable();
+ level = rt_hw_interrupt_disable();
}
void ExitCriticalSection(void)
{
- rt_hw_interrupt_enable(level);
+ rt_hw_interrupt_enable(level);
}
diff --git a/components/net/freemodbus-v1.6.0/port/port.h b/components/net/freemodbus-v1.6.0/port/port.h
index 92056116b8..73d2177c9a 100644
--- a/components/net/freemodbus-v1.6.0/port/port.h
+++ b/components/net/freemodbus-v1.6.0/port/port.h
@@ -30,11 +30,11 @@
#include <assert.h>
#include <inttypes.h>
-#define INLINE
+#define INLINE
#define PR_BEGIN_EXTERN_C extern "C" {
-#define PR_END_EXTERN_C }
+#define PR_END_EXTERN_C }
-#define ENTER_CRITICAL_SECTION() EnterCriticalSection()
+#define ENTER_CRITICAL_SECTION() EnterCriticalSection()
#define EXIT_CRITICAL_SECTION() ExitCriticalSection()
typedef uint8_t BOOL;
diff --git a/components/net/freemodbus-v1.6.0/port/portserial.c b/components/net/freemodbus-v1.6.0/port/portserial.c
index 3a5f8eab62..317c7f4605 100644
--- a/components/net/freemodbus-v1.6.0/port/portserial.c
+++ b/components/net/freemodbus-v1.6.0/port/portserial.c
@@ -133,7 +133,7 @@ void vMBPortSerialEnable(BOOL xRxEnable, BOOL xTxEnable)
else
{
/* switch 485 to transmit mode */
- rt_pin_write(MODBUS_SLAVE_RT_CONTROL_PIN_INDEX, PIN_HIGH);
+ rt_pin_write(MODBUS_SLAVE_RT_CONTROL_PIN_INDEX, PIN_HIGH);
/* disable RX interrupt */
serial->ops->control(serial, RT_DEVICE_CTRL_CLR_INT, (void *)RT_DEVICE_FLAG_INT_RX);
}
diff --git a/components/net/freemodbus-v1.6.0/port/portserial_m.c b/components/net/freemodbus-v1.6.0/port/portserial_m.c
index 6c3d4c8299..8ec0d081f1 100644
--- a/components/net/freemodbus-v1.6.0/port/portserial_m.c
+++ b/components/net/freemodbus-v1.6.0/port/portserial_m.c
@@ -57,7 +57,7 @@ BOOL xMBMasterPortSerialInit(UCHAR ucPORT, ULONG ulBaudRate, UCHAR ucDataBits,
* set 485 mode receive and transmit control IO
* @note MODBUS_MASTER_RT_CONTROL_PIN_INDEX need be defined by user
*/
- rt_pin_mode(MODBUS_MASTER_RT_CONTROL_PIN_INDEX, PIN_MODE_OUTPUT);
+ rt_pin_mode(MODBUS_MASTER_RT_CONTROL_PIN_INDEX, PIN_MODE_OUTPUT);
/* set serial name */
if (ucPORT == 1) {
@@ -129,12 +129,12 @@ void vMBMasterPortSerialEnable(BOOL xRxEnable, BOOL xTxEnable)
/* enable RX interrupt */
serial->ops->control(serial, RT_DEVICE_CTRL_SET_INT, (void *)RT_DEVICE_FLAG_INT_RX);
/* switch 485 to receive mode */
- rt_pin_write(MODBUS_MASTER_RT_CONTROL_PIN_INDEX, PIN_LOW);
+ rt_pin_write(MODBUS_MASTER_RT_CONTROL_PIN_INDEX, PIN_LOW);
}
else
{
/* switch 485 to transmit mode */
- rt_pin_write(MODBUS_MASTER_RT_CONTROL_PIN_INDEX, PIN_HIGH);
+ rt_pin_write(MODBUS_MASTER_RT_CONTROL_PIN_INDEX, PIN_HIGH);
/* disable RX interrupt */
serial->ops->control(serial, RT_DEVICE_CTRL_CLR_INT, (void *)RT_DEVICE_FLAG_INT_RX);
}
@@ -154,13 +154,13 @@ void vMBMasterPortSerialEnable(BOOL xRxEnable, BOOL xTxEnable)
void vMBMasterPortClose(void)
{
- serial->parent.close(&(serial->parent));
+ serial->parent.close(&(serial->parent));
}
BOOL xMBMasterPortSerialPutByte(CHAR ucByte)
{
serial->parent.write(&(serial->parent), 0, &ucByte, 1);
- return TRUE;
+ return TRUE;
}
BOOL xMBMasterPortSerialGetByte(CHAR * pucByte)
diff --git a/components/net/freemodbus-v1.6.0/port/porttimer_m.c b/components/net/freemodbus-v1.6.0/port/porttimer_m.c
index 69bdc54879..00441bfd1c 100644
--- a/components/net/freemodbus-v1.6.0/port/porttimer_m.c
+++ b/components/net/freemodbus-v1.6.0/port/porttimer_m.c
@@ -54,44 +54,44 @@ BOOL xMBMasterPortTimersInit(USHORT usTimeOut50us)
void vMBMasterPortTimersT35Enable()
{
- rt_tick_t timer_tick = (50 * usT35TimeOut50us)
- / (1000 * 1000 / RT_TICK_PER_SECOND);
+ rt_tick_t timer_tick = (50 * usT35TimeOut50us)
+ / (1000 * 1000 / RT_TICK_PER_SECOND);
/* Set current timer mode, don't change it.*/
vMBMasterSetCurTimerMode(MB_TMODE_T35);
- rt_timer_control(&timer, RT_TIMER_CTRL_SET_TIME, &timer_tick);
+ rt_timer_control(&timer, RT_TIMER_CTRL_SET_TIME, &timer_tick);
rt_timer_start(&timer);
}
void vMBMasterPortTimersConvertDelayEnable()
{
- rt_tick_t timer_tick = MB_MASTER_DELAY_MS_CONVERT * RT_TICK_PER_SECOND / 1000;
+ rt_tick_t timer_tick = MB_MASTER_DELAY_MS_CONVERT * RT_TICK_PER_SECOND / 1000;
/* Set current timer mode, don't change it.*/
vMBMasterSetCurTimerMode(MB_TMODE_CONVERT_DELAY);
- rt_timer_control(&timer, RT_TIMER_CTRL_SET_TIME, &timer_tick);
+ rt_timer_control(&timer, RT_TIMER_CTRL_SET_TIME, &timer_tick);
rt_timer_start(&timer);
}
void vMBMasterPortTimersRespondTimeoutEnable()
{
- rt_tick_t timer_tick = MB_MASTER_TIMEOUT_MS_RESPOND * RT_TICK_PER_SECOND / 1000;
+ rt_tick_t timer_tick = MB_MASTER_TIMEOUT_MS_RESPOND * RT_TICK_PER_SECOND / 1000;
/* Set current timer mode, don't change it.*/
vMBMasterSetCurTimerMode(MB_TMODE_RESPOND_TIMEOUT);
- rt_timer_control(&timer, RT_TIMER_CTRL_SET_TIME, &timer_tick);
+ rt_timer_control(&timer, RT_TIMER_CTRL_SET_TIME, &timer_tick);
rt_timer_start(&timer);
}
void vMBMasterPortTimersDisable()
{
- rt_timer_stop(&timer);
+ rt_timer_stop(&timer);
}
void prvvTIMERExpiredISR(void)
diff --git a/components/net/freemodbus-v1.6.0/port/user_mb_app.c b/components/net/freemodbus-v1.6.0/port/user_mb_app.c
index e6fdede11f..8da7376336 100644
--- a/components/net/freemodbus-v1.6.0/port/user_mb_app.c
+++ b/components/net/freemodbus-v1.6.0/port/user_mb_app.c
@@ -260,8 +260,8 @@ eMBErrorCode eMBRegDiscreteCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT us
if ((usAddress >= DISCRETE_INPUT_START)
&& (usAddress + usNDiscrete <= DISCRETE_INPUT_START + DISCRETE_INPUT_NDISCRETES))
{
- iRegIndex = (USHORT) (usAddress - usDiscreteInputStart) / 8; //ÿ���Ĵ�����8��
- iRegBitIndex = (USHORT) (usAddress - usDiscreteInputStart) % 8; //����ڼĴ����ڲ���λ��ַ
+ iRegIndex = (USHORT) (usAddress - usDiscreteInputStart) / 8;
+ iRegBitIndex = (USHORT) (usAddress - usDiscreteInputStart) % 8;
while (iNReg > 0)
{