17 TeensyTimerTool::PeriodicTimer watchdog_timer_;
26 bool check_pressure_high()
const;
32 bool check_pressure_low()
const;
38 bool failed_to_build_pneumatic_pressure_in_engage_time()
const;
43 bool failed_to_build_pneumatic_pressure_in_release_time()
const;
49 bool failed_to_build_hydraulic_pressure_in_time()
const;
54 bool failed_to_reduce_hydraulic_pressure_in_time()
const;
59 void handle_ebs_check();
210 DEBUG_PRINT(
"ASMS activated, starting watchdog check");
216 _watchdog_toggle_timer_.
reset();
217 DEBUG_PRINT(
"Watchdog ready, starting toggle sequence");
226 DEBUG_PRINT(
"Watchdog error: WD_READY went low during toggling phase");
235 _watchdog_test_timer_.
reset();
236 DEBUG_PRINT(
"Watchdog toggle complete, stopping watchdog");
241 _watchdog_test_timer_.
reset();
243 DEBUG_PRINT(
"Stopping watchdog toggle, beginning verification");
251 DEBUG_PRINT(
"Watchdog no longer ready - verification successful");
255 DEBUG_PRINT(
"Watchdog test failed - WD_READY did not go low during verification time");
301 DEBUG_PRINT(
"Checkup complete and returning success");
310inline void CheckupManager::handle_ebs_check() {
320 if (check_pressure_high()) {
321 DEBUG_PRINT(
"Pressure high confirmed with only actuator 2");
342 if (check_pressure_high()) {
343 DEBUG_PRINT(
"Pressure high confirmed with only actuator 1");
358 DEBUG_PRINT(
"EBS check complete, transitioning to next state");
397 failed_to_build_pneumatic_pressure_in_engage_time() ||
400 failed_to_build_hydraulic_pressure_in_time() ||
408 failed_to_build_pneumatic_pressure_in_release_time() ||
413inline bool CheckupManager::check_pressure_high()
const {
418inline bool CheckupManager::check_pressure_low()
const {
423bool CheckupManager::failed_to_build_pneumatic_pressure_in_engage_time()
const {
427bool CheckupManager::failed_to_build_pneumatic_pressure_in_release_time()
const {
431bool CheckupManager::failed_to_build_hydraulic_pressure_in_time()
const {
436bool CheckupManager::failed_to_reduce_hydraulic_pressure_in_time()
const {
The CheckupManager class handles various checkup operations.
bool should_stay_manual_driving() const
Performs a manual driving checkup.
bool should_enter_emergency_in_ready_state() const
EbsPressureTestPhase pressure_test_phase_
bool should_enter_emergency(State current_state) const
Performs an emergency checkup.
Metro _ebs_sound_timestamp_
Timer for the EBS buzzer sound check.
CheckupState checkup_state_
Current state of the checkup process.
bool should_enter_emergency_in_driving_state() const
@ ERROR_TIMESTAMPS_EMERGENCY
bool emergency_sequence_complete() const
Checks if the emergency sequence is complete and the vehicle can transition to AS_OFF.
bool should_stay_ready() const
Performs a ready to drive checkup.
CheckupState
The CheckupState enum represents the different states of the initial checkup process....
@ START_TOGGLING_WATCHDOG
@ START_TOGGLING_WATCHDOG_AGAIN
bool should_go_ready_from_off() const
Performs a last re-check for off to ready transition.
void reset_checkup_state()
Resets the checkup state to the initial state.
bool should_stay_off()
Performs an off checkup.
bool should_stay_mission_finished() const
Performs a mission finished checkup.
bool res_triggered() const
Checks if the RES has been triggered.
bool should_stay_driving() const
CheckupManager(SystemData *system_data)
Constructor for the CheckupManager class.
CheckupError initial_checkup_sequence()
Performs an initial checkup.
static void disable_ebs_actuator_2()
Disables EBS actuator 2.
static void enable_ebs_actuator_2()
Enables EBS actuator 2.
static void enable_ebs_actuator_1()
Enables EBS actuator 1.
static void close_watchdog_sdc()
Closes the watchdog signal for SDC.
static void disable_ebs_actuator_1()
Disables EBS actuator 1.
static void toggle_watchdog()
Toggles the watchdog signal.
static void close_sdc()
Closes the SDC in Master and SDC Logic.
Our own implementation of Metro class.
void reset()
Resets the timer to the current time.
bool checkWithoutReset() const
Checks if the interval has passed without resetting the timer.
constexpr int WATCHDOG_TEST_DURATION
constexpr int WATCHDOG_TOGGLE_DURATION
constexpr int EBS_BUZZER_TIMEOUT
bool has_any_component_timed_out()
int _hydraulic_line_pressure
bool pneumatic_line_pressure_
void reset_ebs_timestamp()
resets timestamps for driving
void enter_ready_state()
resets timestamps for ready
Metro releaseEbsTimestamp
The whole model of the system: holds all the data necessary.
FailureDetection failure_detection_
HardwareData hardware_data_