Skip to content

Commit

Permalink
1、【修改】FreeModbus主机中几处单词拼写错误
Browse files Browse the repository at this point in the history
Signed-off-by: armink <[email protected]>
  • Loading branch information
armink committed Jan 8, 2014
1 parent 58f8bdb commit b02d228
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions FreeModbus/modbus/functions/mbfunccoils_m.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ eMBMasterReqReadCoils( UCHAR ucSndAddr, USHORT usCoilAddr, USHORT usNCoils ,LONG
UCHAR *ucMBFrame;
eMBMasterReqErrCode eErrStatus = MB_MRE_NO_ERR;

if ( xMBasterRunResTake( lTimeOut ) == FALSE ) eErrStatus = MB_MRE_MASTER_BUSY;
if ( xMBMasterRunResTake( lTimeOut ) == FALSE ) eErrStatus = MB_MRE_MASTER_BUSY;
else if ( ucSndAddr > MB_MASTER_TOTAL_SLAVE_NUM ) eErrStatus = MB_MRE_ILL_ARG;
else
{
Expand Down Expand Up @@ -167,7 +167,7 @@ eMBMasterReqWriteCoil( UCHAR ucSndAddr, USHORT usCoilAddr, USHORT usCoilData, LO
UCHAR *ucMBFrame;
eMBMasterReqErrCode eErrStatus = MB_MRE_NO_ERR;

if ( xMBasterRunResTake( lTimeOut ) == FALSE ) eErrStatus = MB_MRE_MASTER_BUSY;
if ( xMBMasterRunResTake( lTimeOut ) == FALSE ) eErrStatus = MB_MRE_MASTER_BUSY;
else if ( usCoilAddr > MB_MASTER_TOTAL_SLAVE_NUM ) eErrStatus = MB_MRE_ILL_ARG;
else if ( ( usCoilData != 0xFF00 ) && ( usCoilData != 0x0000 ) ) eErrStatus = MB_MRE_ILL_ARG;
else
Expand Down Expand Up @@ -249,7 +249,7 @@ eMBMasterReqWriteMultipleCoils( UCHAR ucSndAddr,
UCHAR ucByteCount;
eMBMasterReqErrCode eErrStatus = MB_MRE_NO_ERR;

if ( xMBasterRunResTake( lTimeOut ) == FALSE ) eErrStatus = MB_MRE_MASTER_BUSY;
if ( xMBMasterRunResTake( lTimeOut ) == FALSE ) eErrStatus = MB_MRE_MASTER_BUSY;
else if ( ucSndAddr > MB_MASTER_TOTAL_SLAVE_NUM ) eErrStatus = MB_MRE_ILL_ARG;
else if ( usNCoils > MB_PDU_REQ_WRITE_MUL_COILCNT_MAX ) eErrStatus = MB_MRE_ILL_ARG;
else
Expand Down
2 changes: 1 addition & 1 deletion FreeModbus/modbus/functions/mbfuncdisc_m.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ eMBMasterReqReadDiscreteInputs( UCHAR ucSndAddr, USHORT usDiscreteAddr, USHORT u
UCHAR *ucMBFrame;
eMBMasterReqErrCode eErrStatus = MB_MRE_NO_ERR;

if ( xMBasterRunResTake( lTimeOut ) == FALSE ) eErrStatus = MB_MRE_MASTER_BUSY;
if ( xMBMasterRunResTake( lTimeOut ) == FALSE ) eErrStatus = MB_MRE_MASTER_BUSY;
else if ( ucSndAddr > MB_MASTER_TOTAL_SLAVE_NUM ) eErrStatus = MB_MRE_ILL_ARG;
else
{
Expand Down
8 changes: 4 additions & 4 deletions FreeModbus/modbus/functions/mbfuncholding_m.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ eMBMasterReqWriteHoldingRegister( UCHAR ucSndAddr, USHORT usRegAddr, USHORT usRe
UCHAR *ucMBFrame;
eMBMasterReqErrCode eErrStatus = MB_MRE_NO_ERR;

if ( xMBasterRunResTake( lTimeOut ) == FALSE ) eErrStatus = MB_MRE_MASTER_BUSY;
if ( xMBMasterRunResTake( lTimeOut ) == FALSE ) eErrStatus = MB_MRE_MASTER_BUSY;
else if ( ucSndAddr > MB_MASTER_TOTAL_SLAVE_NUM ) eErrStatus = MB_MRE_ILL_ARG;
else
{
Expand Down Expand Up @@ -151,7 +151,7 @@ eMBMasterReqWriteMultipleHoldingRegister( UCHAR ucSndAddr,
USHORT usRegIndex = 0;
eMBMasterReqErrCode eErrStatus = MB_MRE_NO_ERR;

if ( xMBasterRunResTake( lTimeOut ) == FALSE ) eErrStatus = MB_MRE_MASTER_BUSY;
if ( xMBMasterRunResTake( lTimeOut ) == FALSE ) eErrStatus = MB_MRE_MASTER_BUSY;
else if ( ucSndAddr > MB_MASTER_TOTAL_SLAVE_NUM ) eErrStatus = MB_MRE_ILL_ARG;
else
{
Expand Down Expand Up @@ -233,7 +233,7 @@ eMBMasterReqReadHoldingRegister( UCHAR ucSndAddr, USHORT usRegAddr, USHORT usNRe
UCHAR *ucMBFrame;
eMBMasterReqErrCode eErrStatus = MB_MRE_NO_ERR;

if ( xMBasterRunResTake( lTimeOut ) == FALSE ) eErrStatus = MB_MRE_MASTER_BUSY;
if ( xMBMasterRunResTake( lTimeOut ) == FALSE ) eErrStatus = MB_MRE_MASTER_BUSY;
else if ( ucSndAddr > MB_MASTER_TOTAL_SLAVE_NUM ) eErrStatus = MB_MRE_ILL_ARG;
else
{
Expand Down Expand Up @@ -309,7 +309,7 @@ eMBMasterReqReadWriteMultipleHoldingRegister( UCHAR ucSndAddr,
USHORT usRegIndex = 0;
eMBMasterReqErrCode eErrStatus = MB_MRE_NO_ERR;

if ( xMBasterRunResTake( lTimeOut ) == FALSE ) eErrStatus = MB_MRE_MASTER_BUSY;
if ( xMBMasterRunResTake( lTimeOut ) == FALSE ) eErrStatus = MB_MRE_MASTER_BUSY;
else if ( ucSndAddr > MB_MASTER_TOTAL_SLAVE_NUM ) eErrStatus = MB_MRE_ILL_ARG;
else
{
Expand Down
2 changes: 1 addition & 1 deletion FreeModbus/modbus/functions/mbfuncinput_m.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ eMBMasterReqReadInputRegister( UCHAR ucSndAddr, USHORT usRegAddr, USHORT usNRegs
UCHAR *ucMBFrame;
eMBMasterReqErrCode eErrStatus = MB_MRE_NO_ERR;

if ( xMBasterRunResTake( lTimeOut ) == FALSE ) eErrStatus = MB_MRE_MASTER_BUSY;
if ( xMBMasterRunResTake( lTimeOut ) == FALSE ) eErrStatus = MB_MRE_MASTER_BUSY;
else if ( ucSndAddr > MB_MASTER_TOTAL_SLAVE_NUM ) eErrStatus = MB_MRE_ILL_ARG;
else
{
Expand Down
6 changes: 3 additions & 3 deletions FreeModbus/modbus/include/mbport.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ BOOL xMBMasterPortEventPost( eMBMasterEventType eEvent );

BOOL xMBMasterPortEventGet( /*@out@ */ eMBMasterEventType * eEvent );

void vMBasterRunResInit( void );
void vMBMasterRunResInit( void );

BOOL xMBasterRunResTake( int32_t time );
BOOL xMBMasterRunResTake( int32_t time );

void vMBasterRunResRelease( void );
void vMBMasterRunResRelease( void );

/* ----------------------- Serial port functions ----------------------------*/

Expand Down
6 changes: 3 additions & 3 deletions FreeModbus/modbus/mb_m.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ eMBMasterInit( eMBMode eMode, UCHAR ucPort, ULONG ulBaudRate, eMBParity eParity
eMBState = STATE_DISABLED;
}
/* initialize the Mobus Master running resource. */
vMBasterRunResInit();
vMBMasterRunResInit();
}
return eStatus;
}
Expand Down Expand Up @@ -319,7 +319,7 @@ eMBMasterPoll( void )
}
/* If master has exception ,Master will send error process.Otherwise the Master is idle.*/
if (eException != MB_EX_NONE) ( void ) xMBMasterPortEventPost( EV_MASTER_ERROR_PROCESS );
else vMBasterRunResRelease();
else vMBMasterRunResRelease();
break;

case EV_MASTER_FRAME_SENT:
Expand All @@ -329,7 +329,7 @@ eMBMasterPoll( void )
break;

case EV_MASTER_ERROR_PROCESS:
vMBasterRunResRelease();
vMBMasterRunResRelease();
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion FreeModbus/modbus/rtu/mbrtu_m.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ xMBMasterRTUTimerExpired(void)

vMBMasterPortTimersDisable( );
/* If timer mode is convert delay ,then Master is idel now. */
if (eMasterCurTimerMode == MB_TMODE_CONVERT_DELAY) vMBasterRunResRelease();
if (eMasterCurTimerMode == MB_TMODE_CONVERT_DELAY) vMBMasterRunResRelease();

return xNeedPoll;
}
Expand Down
6 changes: 3 additions & 3 deletions FreeModbus/port/portevent_m.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ xMBMasterPortEventGet( eMBMasterEventType * eEvent )
* Note:The resource is define by Operating System.If you not use Opearting System this function can be empty.
*
*/
void vMBasterRunResInit( void )
void vMBMasterRunResInit( void )
{
rt_sem_init(&xMasterRunRes, "master res", 0x01 , RT_IPC_FLAG_PRIO);
}
Expand All @@ -78,7 +78,7 @@ void vMBasterRunResInit( void )
*
* @return resource taked result
*/
BOOL xMBasterRunResTake( LONG lTimeOut )
BOOL xMBMasterRunResTake( LONG lTimeOut )
{
/*If waiting time is -1 .It will wait forever */
return rt_sem_take(&xMasterRunRes, lTimeOut) ? FALSE : TRUE ;
Expand All @@ -89,7 +89,7 @@ BOOL xMBasterRunResTake( LONG lTimeOut )
* Note:The resource is define by Operating System.If you not use Opearting System this function can be empty.
*
*/
void vMBasterRunResRelease( void )
void vMBMasterRunResRelease( void )
{
/* Clear up resource when need release resource. */
rt_sem_control(&xMasterRunRes, RT_IPC_CMD_RESET, 0);
Expand Down

0 comments on commit b02d228

Please sign in to comment.