ROBOTIS-GIT / Dynamixel2Arduino

DYNAMIXEL protocol library for Arduino
Apache License 2.0
88 stars 55 forks source link

Issue115 #131

Closed johnauld closed 2 months ago

johnauld commented 1 year ago

This fixes https://github.com/ROBOTIS-GIT/Dynamixel2Arduino/issues/115. The problem described in that issue is that SerialPortHandler::begin() calls delay() unconditionally, which causes a hang if interrupts are disabled at the time of the call (as is the case during FreeRTOS startup).

The solution here is to add a uint32_t delay parameter to Dynamixel2Arduino::begin() and SerialPortHandler::begin() to allow the caller to specify the amount of delay, or to disable the delay() call entirely by passing zero.

The change is backward-compatible. No existing code will be affected, since both functions provide a default value of 500 (which is equal to the previous, recently changed, hard-coded delay time).