Formula Student Electronics & Software
The code for the embedded software
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
2#include "debugUtils.hpp"
5#include "enum_utils.hpp"
8#include "timings.hpp"
9
16
21// only publih debug log if there is a change in one of the states
22uint8_t master_state_helper = static_cast<uint8_t>(15);
23uint8_t checkup_state_helper = static_cast<uint8_t>(15);
24uint8_t mission_helper = static_cast<uint8_t>(15);
25
26void setup() {
27 Serial.begin(9600);
33 DEBUG_PRINT("Starting up...");
34}
35
void setup()
Definition main.cpp:10
void loop()
AMI main loop: Button gets picked and lights up the corresponding LED LAST BUTTON CHECKED WINS.
Definition main.cpp:23
The ASState class manages and transitions between different states of the vehicle system.
void calculate_state()
Calculates the state of the vehicle.
CheckupManager _checkup_manager_
CheckupManager object for handling various checkup operations.
State state_
Current state of the vehicle system, initialized to OFF.
CheckupState checkup_state_
Current state of the checkup process.
Class that contains definitions of typical messages to send via CAN It serves only as an example of t...
static int publish_mission(int mission_id)
Publish AS Mission to CAN.
void init()
Initializes the CAN bus.
static int publish_debug_log(SystemData system_data, uint8_t sate, uint8_t state_checkup)
Publish AS Mission to CAN.
static SystemData * _systemData
static int publish_state(int state_id)
Publish AS State to CAN.
Class responsible for the reading of the digital inputs into the Master teensy.
void digital_reads()
read all digital inputs
Class responsible for controlling digital outputs in the Master Teensy.
Our own implementation of Metro class.
Definition metro.h:13
void reset()
Resets the timer to the current time.
Definition metro.h:124
bool check()
Checks if the interval has passed and resets the timer if true.
Definition metro.h:90
#define DEBUG_PRINT(str)
constexpr auto to_underlying(Enum e) noexcept
Definition enum_utils.hpp:4
Metro mission_timer
Definition main.cpp:18
Communicator communicator
Definition main.cpp:11
uint8_t checkup_state_helper
Definition main.cpp:23
ASState as_state
Definition main.cpp:15
SystemData system_data
Definition main.cpp:10
DigitalSender digital_sender
Definition main.cpp:14
uint8_t mission_helper
Definition main.cpp:24
uint8_t master_state_helper
Definition main.cpp:22
Metro rl_rpm_timer
Definition main.cpp:17
Metro state_timer
Definition main.cpp:19
DigitalReceiver digital_receiver
Definition main.cpp:12
IntervalTimer state_calculation_timer
Definition main.cpp:20
The whole model of the system: holds all the data necessary.
Mission mission_
DigitalData digital_data_
constexpr auto MISSION_PUBLISH_INTERVAL
Definition timings.hpp:6
constexpr auto LEFT_WHEEL_PUBLISH_INTERVAL
Definition timings.hpp:4
constexpr auto STATE_PUBLISH_INTERVAL
Definition timings.hpp:5