Formula Student Electronics & Software
The code for the embedded software
Loading...
Searching...
No Matches
statemachine.hpp File Reference
#include <Arduino.h>
#include <Bounce2.h>
#include "apps.h"
#include "can.h"
#include "debug.h"
#include "display.h"
Include dependency graph for statemachine.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define buzzerPin   4
 
#define R2D_PIN   32
 
#define R2D_TIMEOUT   500
 
#define APPS_1_PIN   41
 
#define APPS_2_PIN   40
 
#define STARTUP_DELAY_MS   10000
 
#define APPS_READ_PERIOD_MS   20
 
#define BAMOCAR_ATTENUATION_FACTOR   1
 
#define ASBuzzer   8000
 

Enumerations

enum  status { IDLE , DRIVING , ASDRIVING }
 

Functions

void playR2DSound ()
 
void statemachine ()
 

Variables

volatile bool TSOn
 
volatile bool R2DOverride
 
Bounce r2dButton
 
volatile bool ASReady
 
elapsedMillis R2DTimer
 
elapsedMillis APPSTimer
 
CAN_message_t disable
 
FlexCAN_T4< CAN1, RX_SIZE_256, TX_SIZE_16 > can1
 
status R2DStatus
 

Macro Definition Documentation

◆ APPS_1_PIN

#define APPS_1_PIN   41

Definition at line 14 of file statemachine.hpp.

◆ APPS_2_PIN

#define APPS_2_PIN   40

Definition at line 15 of file statemachine.hpp.

◆ APPS_READ_PERIOD_MS

#define APPS_READ_PERIOD_MS   20

Definition at line 19 of file statemachine.hpp.

◆ ASBuzzer

#define ASBuzzer   8000

Definition at line 22 of file statemachine.hpp.

◆ BAMOCAR_ATTENUATION_FACTOR

#define BAMOCAR_ATTENUATION_FACTOR   1

Definition at line 20 of file statemachine.hpp.

◆ buzzerPin

#define buzzerPin   4

Definition at line 9 of file statemachine.hpp.

◆ R2D_PIN

#define R2D_PIN   32

Definition at line 11 of file statemachine.hpp.

◆ R2D_TIMEOUT

#define R2D_TIMEOUT   500

Definition at line 12 of file statemachine.hpp.

◆ STARTUP_DELAY_MS

#define STARTUP_DELAY_MS   10000

Definition at line 17 of file statemachine.hpp.

Enumeration Type Documentation

◆ status

enum status
Enumerator
IDLE 
DRIVING 
ASDRIVING 

Definition at line 37 of file statemachine.hpp.

Function Documentation

◆ playR2DSound()

void playR2DSound ( )

Definition at line 46 of file statemachine.hpp.

Here is the caller graph for this function:

◆ statemachine()

void statemachine ( )

Definition at line 53 of file statemachine.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ APPSTimer

elapsedMillis APPSTimer

Definition at line 30 of file statemachine.hpp.

◆ ASReady

volatile bool ASReady
extern

Definition at line 22 of file main.cpp.

◆ can1

FlexCAN_T4<CAN1, RX_SIZE_256, TX_SIZE_16> can1
extern

Definition at line 87 of file main.cpp.

◆ disable

CAN_message_t disable
extern

Definition at line 6 of file can.cpp.

◆ r2dButton

Bounce r2dButton
extern

Definition at line 42 of file main.cpp.

◆ R2DOverride

volatile bool R2DOverride
extern

Definition at line 32 of file statemachine.hpp.

◆ R2DStatus

status R2DStatus

Definition at line 44 of file statemachine.hpp.

◆ R2DTimer

elapsedMillis R2DTimer
extern

Definition at line 44 of file main.cpp.

◆ TSOn

volatile bool TSOn
extern

Definition at line 19 of file main.cpp.