Skip to content

State change rejection reasons#214

Open
chpy04 wants to merge 4 commits into
mainfrom
state-change-rejection-reasons
Open

State change rejection reasons#214
chpy04 wants to merge 4 commits into
mainfrom
state-change-rejection-reasons

Conversation

@chpy04

@chpy04 chpy04 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@caiodasilva2005 caiodasilva2005 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now there is no

Comment thread Core/Src/u_statemachine.c

static int transition_functional_state(func_state_t new_state)
{
cerberus_state.state_transition_error = ERROR_OK;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because right now you are only clearing when the driver attempts another transition, which is probably fine. Just worth considering for better UX

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Core/Inc/u_statemachine.h Outdated
DRIVE_FROM_FAULT = 1 << 1,
ENTER_DRIVE_DISABLED = 1 << 2,
ENTER_DRIVE_SHUTDOWN_OPEN = 1 << 3,
ENTER_DRIVE_BREAKS_NOT_ENGAGED = 1 << 4,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible typo

Comment thread Core/Inc/u_statemachine.h Outdated
ERROR_OK = 0,
REVERSE_DISABLED = 1 << 0,
DRIVE_FROM_FAULT = 1 << 1,
ENTER_DRIVE_DISABLED = 1 << 2,

@TheJeffreyKuo TheJeffreyKuo Jul 3, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bit doesn't appear to be set anywhere in the PR (ENTER_DRIVE_DISABLED)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants