Check requested message before trying callbacks#14
Conversation
samuelsadok
left a comment
There was a problem hiding this comment.
Intent and implementation looks good to me.
Technically it could be a breaking change for someone but the previous behavior seems a bit quirky to rely on and we can bump the library version to 0.11.
Do you mind doing a rebase & force-push to trigger the new CI test? (see comment on #12)
7c4f624 to
c88f8a4
Compare
I've rebased on master and force-pushed, but nothing seems to have been triggered. Could it be that the workflows need approval? |
samuelsadok
left a comment
There was a problem hiding this comment.
Thanks! Yes the workflows need approval to run.
|
This definitely broke my code. The new behavior is more inline with the expectation of how the It is absolutely a breaking change, and it is missing from the CHANGELOG. |
|
Can you give an minimal example of the code that broke? |
In 0.10.6 the above code will print an error message ( When the callback is registered, the code above works as expected to confirm the ODrive is connected. In 0.10.9, this code fails to exit the To achieve the code above in 0.10.9 the loop looks like this: The behavior in 0.10.9 is more uniform in that callbacks are only triggered when the message from the ODrive comes in without being requested by the Arduino. In my opinion, this is an improvement. As for what I would like to see in the changelog, I think a line about the new |
Hi,
I encountered this while working on #13.
Here is an example program to reproduce it: https://gist.github.com/BrechtSerckx/e682a30fb946292be58ab2be64ed49e3.
When no feedback handler is registered, calls to
getFeedbackfail. When a feedback handler is registered, calls still fail, but the callback is called.getFeedbackshould not conflict with registered callbacks.This patch first checks if a CAN message has been requested. Only if it wasn't, the callback handlers are checked.