Formula Student Electronics & Software
The code for the embedded software
Loading...
Searching...
No Matches
test_C3.cpp File Reference
#include "unity.h"
#include "statemachine.hpp"
#include "Arduino.h"
Include dependency graph for test_C3.cpp:

Go to the source code of this file.

Macros

#define GREEN_LED_1   4
 
#define GREEN_LED_2   5
 
#define GREEN_LED_3   6
 
#define RED_LED_1   0
 
#define RED_LED_2   1
 
#define YELLOW_LED_1   2
 
#define YELLOW_LED_2   3
 
#define BUTTON_1   7
 
#define BUTTON_2   8
 
#define BUTTON_3   9
 
#define BUTTON_4   10
 
#define BUTTON_5   11
 
#define BUTTON_6   12
 
#define POTENCIO   14
 
#define BK_SENSOR_PIN   POTENCIO
 
#define R2D_PIN   BUTTON_1
 
#define TSON_PIN   BUTTON_2
 
#define AS_READY_PIN   BUTTON_3
 
#define STOP_PIN   BUTTON_4
 
#define STATE_IDLE_GREEN_LED_1_PIN   GREEN_LED_1
 
#define STATE_IDLE_GREEN_LED_2_PIN   GREEN_LED_2
 
#define STATE_IDLE_GREEN_LED_3_PIN   GREEN_LED_3
 
#define STATE_DRIVING_RED_LED_1_PIN   RED_LED_1
 
#define STATE_DRIVING_RED_LED_2_PIN   RED_LED_2
 
#define STATE_ASDRIVING_YELLOW_LED_1_PIN   YELLOW_LED_1
 
#define STATE_ASDRIVING_YELLOW_LED_2_PIN   YELLOW_LED_2
 

Functions

void brakeValueUpdate ()
 
void updateTS ()
 
void updateASReady ()
 
void stopTest ()
 
void test_state_machine ()
 
void test_IDLE_2_DRIVING ()
 
void test_IDLE_2_ASDRIVING ()
 
void test_ASDRIVING_2_IDLE ()
 
void test_DRIVING_2_IDLE ()
 
void Setup ()
 
int main (int argc, char **argv)
 

Variables

volatile bool TSOn
 

Macro Definition Documentation

◆ AS_READY_PIN

#define AS_READY_PIN   BUTTON_3

Definition at line 25 of file test_C3.cpp.

◆ BK_SENSOR_PIN

#define BK_SENSOR_PIN   POTENCIO

Definition at line 22 of file test_C3.cpp.

◆ BUTTON_1

#define BUTTON_1   7

Definition at line 12 of file test_C3.cpp.

◆ BUTTON_2

#define BUTTON_2   8

Definition at line 13 of file test_C3.cpp.

◆ BUTTON_3

#define BUTTON_3   9

Definition at line 14 of file test_C3.cpp.

◆ BUTTON_4

#define BUTTON_4   10

Definition at line 15 of file test_C3.cpp.

◆ BUTTON_5

#define BUTTON_5   11

Definition at line 16 of file test_C3.cpp.

◆ BUTTON_6

#define BUTTON_6   12

Definition at line 17 of file test_C3.cpp.

◆ GREEN_LED_1

#define GREEN_LED_1   4

Definition at line 5 of file test_C3.cpp.

◆ GREEN_LED_2

#define GREEN_LED_2   5

Definition at line 6 of file test_C3.cpp.

◆ GREEN_LED_3

#define GREEN_LED_3   6

Definition at line 7 of file test_C3.cpp.

◆ POTENCIO

#define POTENCIO   14

Definition at line 18 of file test_C3.cpp.

◆ R2D_PIN

#define R2D_PIN   BUTTON_1

Definition at line 23 of file test_C3.cpp.

◆ RED_LED_1

#define RED_LED_1   0

Definition at line 8 of file test_C3.cpp.

◆ RED_LED_2

#define RED_LED_2   1

Definition at line 9 of file test_C3.cpp.

◆ STATE_ASDRIVING_YELLOW_LED_1_PIN

#define STATE_ASDRIVING_YELLOW_LED_1_PIN   YELLOW_LED_1

Definition at line 32 of file test_C3.cpp.

◆ STATE_ASDRIVING_YELLOW_LED_2_PIN

#define STATE_ASDRIVING_YELLOW_LED_2_PIN   YELLOW_LED_2

Definition at line 33 of file test_C3.cpp.

◆ STATE_DRIVING_RED_LED_1_PIN

#define STATE_DRIVING_RED_LED_1_PIN   RED_LED_1

Definition at line 30 of file test_C3.cpp.

◆ STATE_DRIVING_RED_LED_2_PIN

#define STATE_DRIVING_RED_LED_2_PIN   RED_LED_2

Definition at line 31 of file test_C3.cpp.

◆ STATE_IDLE_GREEN_LED_1_PIN

#define STATE_IDLE_GREEN_LED_1_PIN   GREEN_LED_1

Definition at line 27 of file test_C3.cpp.

◆ STATE_IDLE_GREEN_LED_2_PIN

#define STATE_IDLE_GREEN_LED_2_PIN   GREEN_LED_2

Definition at line 28 of file test_C3.cpp.

◆ STATE_IDLE_GREEN_LED_3_PIN

#define STATE_IDLE_GREEN_LED_3_PIN   GREEN_LED_3

Definition at line 29 of file test_C3.cpp.

◆ STOP_PIN

#define STOP_PIN   BUTTON_4

Definition at line 26 of file test_C3.cpp.

◆ TSON_PIN

#define TSON_PIN   BUTTON_2

Definition at line 24 of file test_C3.cpp.

◆ YELLOW_LED_1

#define YELLOW_LED_1   2

Definition at line 10 of file test_C3.cpp.

◆ YELLOW_LED_2

#define YELLOW_LED_2   3

Definition at line 11 of file test_C3.cpp.

Function Documentation

◆ brakeValueUpdate()

void brakeValueUpdate ( )

Definition at line 40 of file test_C3.cpp.

Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 124 of file test_C3.cpp.

Here is the call graph for this function:

◆ Setup()

void Setup ( )

Definition at line 98 of file test_C3.cpp.

Here is the call graph for this function:

◆ stopTest()

void stopTest ( )

Definition at line 54 of file test_C3.cpp.

Here is the caller graph for this function:

◆ test_ASDRIVING_2_IDLE()

void test_ASDRIVING_2_IDLE ( )

Definition at line 84 of file test_C3.cpp.

Here is the call graph for this function:

◆ test_DRIVING_2_IDLE()

void test_DRIVING_2_IDLE ( )

Definition at line 91 of file test_C3.cpp.

Here is the call graph for this function:

◆ test_IDLE_2_ASDRIVING()

void test_IDLE_2_ASDRIVING ( )

Definition at line 76 of file test_C3.cpp.

Here is the call graph for this function:

◆ test_IDLE_2_DRIVING()

void test_IDLE_2_DRIVING ( )

Definition at line 66 of file test_C3.cpp.

Here is the call graph for this function:

◆ test_state_machine()

void test_state_machine ( )

Definition at line 60 of file test_C3.cpp.

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

◆ updateASReady()

void updateASReady ( )

Definition at line 50 of file test_C3.cpp.

Here is the caller graph for this function:

◆ updateTS()

void updateTS ( )

Definition at line 46 of file test_C3.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ TSOn

volatile bool TSOn

Definition at line 35 of file test_C3.cpp.