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).
This fixes https://github.com/ROBOTIS-GIT/Dynamixel2Arduino/issues/115. The problem described in that issue is that
SerialPortHandler::begin()
callsdelay()
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 toDynamixel2Arduino::begin()
andSerialPortHandler::begin()
to allow the caller to specify the amount of delay, or to disable thedelay()
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).