Formula Student Electronics & Software
The code for the embedded software
Loading...
Searching...
No Matches
main.cpp File Reference
#include <Arduino.h>
#include <Bounce2.h>
#include <FlexCAN_T4.h>
#include "apps.h"
#include "can.h"
#include "debug.h"
#include "display.h"
#include "statemachine.hpp"
Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

void sendMout (int value)
 
void checkASEmergencySound ()
 
void setup ()
 
void loop ()
 

Variables

int current_BMS = 0
 
elapsedMillis ASEmergencyTimer
 
volatile bool disabled = false
 
volatile bool BTBReady = false
 
volatile bool transmissionEnabled = false
 
volatile bool TSOn = false
 
volatile bool R2DOverride = false
 
volatile bool ASReady = false
 
FlexCAN_T4< CAN1, RX_SIZE_256, TX_SIZE_16 > can1
 
CAN_message_t statusRequest
 
CAN_message_t disable
 
CAN_message_t DCVoltageRequest
 
CAN_message_t actualSpeedRequest
 
int speed
 
status R2DStatus
 
uint8_t current_byte1
 
uint8_t current_byte2
 
CAN_message_t current_msg
 
Bounce r2dButton = Bounce()
 
elapsedMillis R2DTimer
 
elapsedMillis APPSTimer
 
elapsedMillis CURRENTtimer
 
elapsedMicros mainLoopPeriod
 

Function Documentation

◆ checkASEmergencySound()

void checkASEmergencySound ( )

Definition at line 63 of file main.cpp.

Here is the caller graph for this function:

◆ loop()

void loop ( )

Definition at line 107 of file main.cpp.

Here is the call graph for this function:

◆ sendMout()

void sendMout ( int  value)

Definition at line 49 of file main.cpp.

◆ setup()

void setup ( )

Definition at line 71 of file main.cpp.

Here is the call graph for this function:

Variable Documentation

◆ actualSpeedRequest

CAN_message_t actualSpeedRequest
extern

Definition at line 16 of file can.cpp.

◆ APPSTimer

elapsedMillis APPSTimer
extern

Definition at line 30 of file statemachine.hpp.

◆ ASEmergencyTimer

elapsedMillis ASEmergencyTimer
extern

Definition at line 76 of file can.cpp.

◆ ASReady

volatile bool ASReady = false

Definition at line 22 of file main.cpp.

◆ BTBReady

volatile bool BTBReady = false

Definition at line 16 of file main.cpp.

◆ can1

FlexCAN_T4<CAN1, RX_SIZE_256, TX_SIZE_16> can1
extern

Definition at line 87 of file main.cpp.

◆ current_BMS

int current_BMS = 0

Definition at line 12 of file main.cpp.

◆ current_byte1

uint8_t current_byte1

Definition at line 37 of file main.cpp.

◆ current_byte2

uint8_t current_byte2

Definition at line 38 of file main.cpp.

◆ current_msg

CAN_message_t current_msg

Definition at line 39 of file main.cpp.

◆ CURRENTtimer

elapsedMillis CURRENTtimer

Definition at line 46 of file main.cpp.

◆ DCVoltageRequest

CAN_message_t DCVoltageRequest
extern

Definition at line 15 of file can.cpp.

◆ disable

CAN_message_t disable
extern

Definition at line 6 of file can.cpp.

◆ disabled

volatile bool disabled = false

Definition at line 15 of file main.cpp.

◆ mainLoopPeriod

elapsedMicros mainLoopPeriod

Definition at line 47 of file main.cpp.

◆ r2dButton

Bounce r2dButton = Bounce()

Definition at line 42 of file main.cpp.

◆ R2DOverride

volatile bool R2DOverride = false

Definition at line 20 of file main.cpp.

◆ R2DStatus

status R2DStatus
extern

Definition at line 41 of file main.cpp.

◆ R2DTimer

elapsedMillis R2DTimer

Definition at line 44 of file main.cpp.

◆ speed

int speed
extern

Definition at line 68 of file main.cpp.

◆ statusRequest

CAN_message_t statusRequest
extern

Definition at line 12 of file can.cpp.

◆ transmissionEnabled

volatile bool transmissionEnabled = false

Definition at line 17 of file main.cpp.

◆ TSOn

volatile bool TSOn = false

Definition at line 19 of file main.cpp.