1、【修改】部分文件中的Tabs为空格。

Signed-off-by: armink <armink.ztl@gmail.com>
This commit is contained in:
armink 2015-02-05 19:57:56 +08:00
parent 1168eca6bf
commit 659a82f327
4 changed files with 16 additions and 16 deletions

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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)

View File

@ -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)