forked from espressif/esp-modbus
fix modbus slave wait before send option
This commit is contained in:
9
Kconfig
9
Kconfig
@ -104,6 +104,15 @@ menu "Modbus configuration"
|
|||||||
help
|
help
|
||||||
This option defines the number of data bits per ASCII character.
|
This option defines the number of data bits per ASCII character.
|
||||||
|
|
||||||
|
config FMB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS
|
||||||
|
int "Wait before send for ASCII communication mode (ms)"
|
||||||
|
default 0
|
||||||
|
range 0 1000
|
||||||
|
depends on FMB_COMM_MODE_ASCII_EN
|
||||||
|
help
|
||||||
|
This option defines timeout before slave sends the response in ASCII communication mode.
|
||||||
|
This allows to work with slow masters. Zero means delay before send is disabled.
|
||||||
|
|
||||||
config FMB_SERIAL_ASCII_TIMEOUT_RESPOND_MS
|
config FMB_SERIAL_ASCII_TIMEOUT_RESPOND_MS
|
||||||
int "Response timeout for ASCII communication mode (ms)"
|
int "Response timeout for ASCII communication mode (ms)"
|
||||||
default 1000
|
default 1000
|
||||||
|
@ -121,8 +121,10 @@ PR_BEGIN_EXTERN_C
|
|||||||
* 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.
|
* receiver then he will not receive the response correctly.
|
||||||
*/
|
*/
|
||||||
#ifndef MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS
|
#ifndef CONFIG_FMB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS
|
||||||
#define MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS ( 0 )
|
#define MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS ( 0 )
|
||||||
|
#else
|
||||||
|
#define MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS ( CONFIG_FMB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*! \brief Maximum number of Modbus functions codes the protocol stack
|
/*! \brief Maximum number of Modbus functions codes the protocol stack
|
||||||
|
@ -125,3 +125,8 @@ void vMBPortTimerClose(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void vMBPortTimersDelay(USHORT usTimeOutMS)
|
||||||
|
{
|
||||||
|
vTaskDelay(usTimeOutMS / portTICK_PERIOD_MS);
|
||||||
|
}
|
Reference in New Issue
Block a user