vedderb / bldc

The VESC motor control firmware
2.09k stars 1.31k forks source link

Blocking behaviour of code in tight loops #626

Open CronusElectronics opened 1 year ago

CronusElectronics commented 1 year ago

The blocking nature of the code around the message reading is not welcome in tight control loops. e.g. bool VescUart::getVescValues(uint8_t canId) Sends the get values command then calls receiveUartMessage which waits for a response before returning.

As the response messages are atomic can we just treat the getVescValue function as a request then have a processRX function that handles the response(s)?