Skip to content

Commit

Permalink
freemodbus: Fix remove critical_sections
Browse files Browse the repository at this point in the history
Closes: #3009
  • Loading branch information
KonstantinKondrashov authored and espressif-bot committed Mar 7, 2019
1 parent 5f3bd38 commit 1ef7d09
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
6 changes: 0 additions & 6 deletions components/freemodbus/modbus/ascii/mbascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ eMBASCIIInit( UCHAR ucSlaveAddress, UCHAR ucPort, ULONG ulBaudRate, eMBParity eP
eMBErrorCode eStatus = MB_ENOERR;
( void )ucSlaveAddress;

ENTER_CRITICAL_SECTION( );
ucMBLFCharacter = MB_ASCII_DEFAULT_LF;

if( xMBPortSerialInit( ucPort, ulBaudRate, 7, eParity ) != TRUE )
Expand All @@ -122,18 +121,15 @@ eMBASCIIInit( UCHAR ucSlaveAddress, UCHAR ucPort, ULONG ulBaudRate, eMBParity eP
eStatus = MB_EPORTERR;
}

EXIT_CRITICAL_SECTION( );

return eStatus;
}

void
eMBASCIIStart( void )
{
ENTER_CRITICAL_SECTION( );
vMBPortSerialEnable( TRUE, FALSE );
eRcvState = STATE_RX_IDLE;
EXIT_CRITICAL_SECTION( );

/* No special startup required for ASCII. */
( void )xMBPortEventPost( EV_READY );
Expand All @@ -142,10 +138,8 @@ eMBASCIIStart( void )
void
eMBASCIIStop( void )
{
ENTER_CRITICAL_SECTION( );
vMBPortSerialEnable( FALSE, FALSE );
vMBPortTimersDisable( );
EXIT_CRITICAL_SECTION( );
}

eMBErrorCode
Expand Down
6 changes: 0 additions & 6 deletions components/freemodbus/modbus/rtu/mbrtu.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ eMBRTUInit( UCHAR ucSlaveAddress, UCHAR ucPort, ULONG ulBaudRate, eMBParity ePar
ULONG usTimerT35_50us;

( void )ucSlaveAddress;
ENTER_CRITICAL_SECTION( );

/* Modbus RTU uses 8 Databits. */
if( xMBPortSerialInit( ucPort, ulBaudRate, 8, eParity ) != TRUE )
Expand Down Expand Up @@ -117,15 +116,13 @@ eMBRTUInit( UCHAR ucSlaveAddress, UCHAR ucPort, ULONG ulBaudRate, eMBParity ePar
eStatus = MB_EPORTERR;
}
}
EXIT_CRITICAL_SECTION( );

return eStatus;
}

void
eMBRTUStart( void )
{
ENTER_CRITICAL_SECTION( );
/* Initially the receiver is in the state STATE_RX_INIT. we start
* the timer and if no character is received within t3.5 we change
* to STATE_RX_IDLE. This makes sure that we delay startup of the
Expand All @@ -135,16 +132,13 @@ eMBRTUStart( void )
vMBPortSerialEnable( TRUE, FALSE );
vMBPortTimersEnable( );

EXIT_CRITICAL_SECTION( );
}

void
eMBRTUStop( void )
{
ENTER_CRITICAL_SECTION( );
vMBPortSerialEnable( FALSE, FALSE );
vMBPortTimersDisable( );
EXIT_CRITICAL_SECTION( );
}

// The lines below are required to suppress GCC warnings about unused but set variable 'xFrameReceived'
Expand Down

0 comments on commit 1ef7d09

Please sign in to comment.