22 static void turnOffASSI();
129inline void DigitalSender::turnOffASSI() {
175 static bool blinkState =
false;
176 if (_blinkTimer.
check()) {
177 blinkState = !blinkState;
178 analogWrite(pin, blinkState * 1023);
183 static bool watchdogState =
false;
184 if (_watchdogTimer.
check()) {
185 watchdogState = !watchdogState;
187 _watchdogTimer.
reset();
Class responsible for controlling digital outputs in the Master Teensy.
static constexpr std::array< int, 9 > validOutputPins
static void enterReadyState()
ASSI yellow LED on, ebs valves activated, sdc closed.
DigitalSender()
Constructor for the DigitalSender class.
static void deactivateEBS()
Deactivates the solenoid EBS valves.
void toggleWatchdog()
Toggles the watchdog pin, to ensure certify of masters' liveness.
static void enterFinishState()
ASSI blue LED on, ebs valves activated, sdc open.
static void closeSDC()
Closes the SDC in Master and SDC Logic.
static void enterOffState()
Everything off, sdc open.
void enterDrivingState()
ASSI LEDs yellow flashing, ebs valves deactivated, sdc closed.
void enterEmergencyState()
ASSI LEDs blue flashing, sdc open and buzzer ringing.
static void activateEBS()
Activates the solenoid EBS valves.
static void enterManualState()
Everything off, sdc closed.
static void openSDC()
Opens the SDC in Master and SDC Logic.
void blinkLED(int pin)
Blinks the LED at the given pin.
Our own implementation of Metro class.
void reset()
Resets the timer to the current time.
bool check()
Checks if the interval has passed and resets the timer if true.
#define SDC_LOGIC_CLOSE_SDC_PIN
#define WD_PULSE_INTERVAL_MS
#define SDC_LOGIC_WATCHDOG_OUT_PIN
#define MASTER_SDC_OUT_PIN
#define LED_BLINK_INTERVAL