State change rejection reasons#214
Conversation
caiodasilva2005
left a comment
There was a problem hiding this comment.
Right now there is no
|
|
||
| static int transition_functional_state(func_state_t new_state) | ||
| { | ||
| cerberus_state.state_transition_error = ERROR_OK; |
There was a problem hiding this comment.
we just need to make sure the message shows on nero for only a set time and not forever after the driver tries to enter drive mode. So that can be handled on nero side or we can do this on our side if we have a function where you pass in the error. Then in the function you start a timer that on its callback clears the state_transition_error, so that it resets a bit after the transition is attempted. I think I prefer the latter more, because then on NERO side all we have to do is display what is currently received in the CAN message
There was a problem hiding this comment.
because right now you are only clearing when the driver attempts another transition, which is probably fine. Just worth considering for better UX
There was a problem hiding this comment.
On the NERO side this will likely just be status text in a corner of the nav menu that displays whatever the current mask says and shows nothing when it reads 0. Since a successful transition already resets to ERROR_OK, the text clears itself on success, so I don't think a firmware timer is needed. One thing to flag is that a successful GAMES entry only goes through transition_nero_state(), which never resets the error. Moving the reset to the start of every attempt should fix this.
| DRIVE_FROM_FAULT = 1 << 1, | ||
| ENTER_DRIVE_DISABLED = 1 << 2, | ||
| ENTER_DRIVE_SHUTDOWN_OPEN = 1 << 3, | ||
| ENTER_DRIVE_BREAKS_NOT_ENGAGED = 1 << 4, |
| ERROR_OK = 0, | ||
| REVERSE_DISABLED = 1 << 0, | ||
| DRIVE_FROM_FAULT = 1 << 1, | ||
| ENTER_DRIVE_DISABLED = 1 << 2, |
There was a problem hiding this comment.
This bit doesn't appear to be set anywhere in the PR (ENTER_DRIVE_DISABLED)
No description provided.