Merge branch 'bugfix/fix_rx_sema_destroy' into 'master'

Modbus fix rx semaphore destroy

See merge request idf/esp-modbus!26
This commit is contained in:
Alex Lisitsyn
2023-01-12 03:24:58 +08:00
2 changed files with 10 additions and 1 deletions

View File

@ -78,6 +78,14 @@ static BOOL xMBMasterPortRxSemaInit( void )
return TRUE;
}
static void vMBMasterPortRxSemaClose( void )
{
if (xMasterSemaRxHandle) {
vSemaphoreDelete(xMasterSemaRxHandle);
xMasterSemaRxHandle = NULL;
}
}
static BOOL xMBMasterPortRxSemaTake( LONG lTimeOut )
{
BaseType_t xStatus = pdTRUE;
@ -337,6 +345,7 @@ BOOL xMBMasterPortSerialInit( UCHAR ucPORT, ULONG ulBaudRate, UCHAR ucDataBits,
void vMBMasterPortSerialClose(void)
{
vMBMasterPortRxSemaClose();
(void)vTaskDelete(xMbTaskHandle);
ESP_ERROR_CHECK(uart_driver_delete(ucUartNumber));
}

View File

@ -1,4 +1,4 @@
version: "1.0.7"
version: "1.0.8"
description: ESP-MODBUS is the official Modbus library for Espressif SoCs.
url: https://github.com/espressif/esp-modbus
dependencies: