espressif / esp-modbus

ESP-Modbus - the officially suppported library for Modbus protocol (serial RS485 + TCP over WiFi or Ethernet).
Apache License 2.0
85 stars 46 forks source link

function vMBPortTimersDelay is missing (IDFGH-11279) #38

Closed jamesarm97 closed 6 months ago

jamesarm97 commented 9 months ago

Just updated and my linker is complaining about vMBPortTimersDelay is missing. I see it referenced in mbport.h and mb.c. Was this removed and you have to provide it in your code now? It was at the end of port/porttimer.c

void vMBPortTimersDelay(USHORT usTimeOutMS) { vTaskDelay(usTimeOutMS / portTICK_PERIOD_MS); }

alisitsyn commented 9 months ago

Hello @jamesarm97 ,

Thank you for the issue. You are right and this is mistake. So, the mbport.h file contains the declaration of the function vMBPortTimersDelay() prototype. Linking fails if a function is used is not found. If the MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS!=0 && comm mode is ASCII the function is used otherwise this does not cause the linker issue and the tests are passed. The issue is confirmed and will be addressed later accordingly.

alisitsyn commented 6 months ago

The fix is merged with commit ID 94e9664aaa552718f1c2d76ef3490edf755fc7cd.