You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for your PR, I really appreciate it.
Do you have an idea from which firmware version onwards the behavior has changed? Maybe it makes sense to enhance the PR to support both newer and older versions
@thankthemaker I'm glad to contribute! Thank you for the project!
AFAIK this wasn't changed in the float/refloat packages for ages it's just how rESCue/src/CanBus.cpp maps the switchState. When we receive switchState value 2 on can bus it is mapped to vescData->switchState=3 and since current rESCue/src/LightBarController.cpp implementation doesn't have case 3 in switch (intState) it logs Unknown switch state.
Float/refloat packages are using value 2 (for compatibility) when both sensors are activated: vesc_pkg-float/blob/main/float/float/footpad_sensor.c refloat/blob/main/src/footpad_sensor.c
After looking in float/refloat code from above now I'm actually thinking that the fix should be applied in rESCue/src/CanBus.cpp
I mean to remove this switch statement completely in order to make the logic align with VESC UART and with what rESCue/src/LightBarController.cpp expects. I'm not sure why this switchState mapper in rESCue/src/CanBus.cpp was added in the first place though if no other place in the code expects value 3.
Please let me know what you think.
The original fix in PR fixed the issue for me since I was using CAN and actually never tried UART.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR should fix unknown switch state error that causes status bar behaviour described in this issue: #88
switchState set in Canbus.cpp was not corresponding to switchState mapper in LightBarController.cpp
rESCue/src/CanBus.cpp
Lines 632 to 643 in ccd3f1f
rESCue/src/LightBarController.cpp
Lines 134 to 143 in ccd3f1f