Closed BertvanRossem closed 2 years ago
I just changed the code to allow a user-definable timeout of the function. The default of 100ms is quite long with higher baud rates, so now you can set it yourself. The constructor has a default value of the old 100ms, so the code is backward compatible.
This is a very useful change. For my application I had to reduce the timeout value as well.
Is there anything stopping this from being merged?
I think only @SolidGeek and @VR-AntHill have write access
Thanks! I don't know why it has not been merged yet. I have not heard anything from either of them. I now just use my own, since this repo hasn't had any updates. However a merge would be nice.
it looks like reading the fault code has been added. https://github.com/SolidGeek/VescUart/blob/master/src/VescUart.cpp#L207
not an adjustable timeout though. not sure that's needed?
The error that is read out is put into a uint8_t, instead of the proper enum.
My code runs a pid loop at 20Hz, so if the vesc code hangs by 100ms, it screws up all the timing. Now I can change it to something like 10ms to solve that problem.
Hi,
I was using your library to control my vesc, but it often went into error. With this simple change, it also reads out the mc_fault_code enum sent over, so you can check what the error is.
Thanks for your library!