File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,9 @@ void CANWrapper::processCANRx() {
132
132
ETCState state = this ->etc .getState ();
133
133
state.ts_ready = rx.data [0 ] & 0x08 ;
134
134
this ->etc .updateStateFromCAN (state);
135
+ if (!this ->etc .getState ().ts_ready ) {
136
+ this ->etc .turnOffMotor ();
137
+ }
135
138
break ;
136
139
}
137
140
}
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ void ETCController::checkStartConditions() {
121
121
// If the brake is pressed past the tolerance threshold and the tractive system is ready
122
122
// then the motor can be enabled. The last condition for motor start is the cockpit switch
123
123
// being set to the ON position, which is what calls this method.
124
- if (this ->state .ts_ready && this ->state .brakes_read >= ETCController::BRAKE_TOLERANCE) {
124
+ if (this ->state .ts_ready && this ->state .brakes_read >= ETCController::BRAKE_TOLERANCE && this -> state . pedal_travel <= 0.01 ) {
125
125
this ->state .motor_enabled = true ;
126
126
this ->runRTDS ();
127
127
}
@@ -130,7 +130,7 @@ void ETCController::checkStartConditions() {
130
130
131
131
void ETCController::runRTDS () {
132
132
this ->rtdsOutput .write (true );
133
- this ->rtdsTicker .attach (callback ([this ] {this ->stopRTDS ();}), 1s );
133
+ this ->rtdsTicker .attach (callback ([this ] {this ->stopRTDS ();}), 1000ms );
134
134
}
135
135
136
136
You can’t perform that action at this time.
0 commit comments