3030
3131/* Globals. */
3232static state_t cerberus_state ;
33- static bool is_ts_rising = false;
34- static bool enter_drive_enabled = false;
35-
36- /* Rising TS Callback and Timer */
37- static void _rising_ts_cb (ULONG input ) {
38- PRINTLN_INFO ("rising ts callback" );
39- enter_drive_enabled = true;
40- }
41- static timer_t ts_rising_timer = {
42- .name = "TS Rising Timer" ,
43- .callback = _rising_ts_cb ,
44- .callback_input = 0 ,
45- .duration = TS_RISING_BLOCK_TIMEOUT ,
46- .type = ONESHOT ,
47- .auto_activate = false
48- };
4933
5034void send_carstate_msg (void )
5135{
@@ -54,7 +38,7 @@ void send_carstate_msg(void)
5438 get_nero_state ().home_mode ,
5539 get_nero_state ().nero_index ,
5640 dti_get_mph (),
57- ( ),
41+ is_shutdown_closed (),
5842 pedals_getTorqueLimitPercentage (),
5943 (cerberus_state .functional != F_REVERSE ),
6044 pedals_getRegenLimit (),
@@ -65,13 +49,6 @@ void send_carstate_msg(void)
6549}
6650
6751int init_statemachine (void ) {
68- /* Create TS Rising Timer. */
69- int status = timer_init (& ts_rising_timer );
70- if (status != U_SUCCESS ) {
71- PRINTLN_ERROR ("Failed to create TS Rising timer (Status: %d)." , status );
72- return U_ERROR ;
73- }
74-
7552 PRINTLN_INFO ("Ran init_statemachine()." );
7653 return U_SUCCESS ;
7754}
@@ -137,25 +114,20 @@ static int transition_functional_state(func_state_t new_state)
137114
138115 brake_state = pedals_getBrakeState ();
139116#ifdef TSMS_OVERRIDE
140- if (!is_shutdown_closed () && (!brake_state || cerberus_state .functional == FAULTED )) { // only enforce brake / fault if tsms is actually on
141- return 3 ;
142- }
117+ // if (!is_shutdown_closed() && (!brake_state || cerberus_state.functional == FAULTED)) { // only enforce brake / fault if tsms is actually on
118+ // return 3;
119+ // }
143120 printf ("Ignoring tsms\n\n" );
144121#else
145122 if (cerberus_state .functional == FAULTED ) {
146123 printf ("Cannot drive from a fault!\n" );
147124 return 3 ;
148125 }
149126
150- if (!enter_drive_enabled ) {
151- printf ("Must wait before entering drive!" );
152- return 3 ;
153- }
154-
155127 /* Only turn on motor if brakes engaged and shutdown is closed */
156- if (!brake_state || !is_shutdown_closed ()) {
157- return 3 ;
158- }
128+ // if (!brake_state || !is_shutdown_closed()) {
129+ // return 3;
130+ // }
159131#endif
160132
161133 if (is_shutdown_closed ()) {
0 commit comments