Skip to content

Commit

Permalink
Feature/disable reverse (#271)
Browse files Browse the repository at this point in the history
Co-authored-by: Caio <[email protected]>
  • Loading branch information
DimitryP6 and caiodasilva2005 authored Feb 1, 2025
1 parent a8e2e56 commit 622df3b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Core/Src/state_machine.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

#define SEND_NERO_TIMEOUT 500 /*in millis*/

//#define DISABLE_REVERSE

/* Internal State of Vehicle */
static state_t cerberus_state;

Expand Down Expand Up @@ -173,6 +175,7 @@ static int transition_nero_state(nero_state_t new_state, pdu_t *pdu, dti_t *mc,
if (new_state.nero_index >= MAX_NERO_STATES)
new_state.nero_index = MAX_NERO_STATES - 1;

#ifndef DISABLE_REVERSE
// Wasn't in home mode and still are not in home mode (Infer a Select Request)
if (!current_nero_state.home_mode && !new_state.home_mode) {
// Only Check if we are in pit mode to toggle direction
Expand All @@ -188,6 +191,7 @@ static int transition_nero_state(nero_state_t new_state, pdu_t *pdu, dti_t *mc,
}
}
}
#endif

// Selecting a mode on NERO
if (current_nero_state.home_mode && !new_state.home_mode) {
Expand Down

0 comments on commit 622df3b

Please sign in to comment.