From 5e6254029ae80721f029085278b199978b064129 Mon Sep 17 00:00:00 2001 From: Aadi Desai <21363892+supleed2@users.noreply.github.com> Date: Sun, 13 Jun 2021 00:50:38 +0100 Subject: [PATCH] Add instruction.h Struct for holding instructions in FIFO Queue, enum for instruction types --- Control/include/instruction.h | 21 +++++++++++++++++++++ Control/src/main.cpp | 1 + 2 files changed, 22 insertions(+) create mode 100644 Control/include/instruction.h diff --git a/Control/include/instruction.h b/Control/include/instruction.h new file mode 100644 index 0000000..574d542 --- /dev/null +++ b/Control/include/instruction.h @@ -0,0 +1,21 @@ +#ifndef INSTRUCTION_H +#define INSTRUCTION_H + +typedef enum { + INSTR_RESET = -1, + INSTR_STOP, + INSTR_MOVE, + INSTR_CHARGE +} instr_t; + +typedef struct instruction +{ + int id; + int instr; + int heading; + int distance; + float speed; + int charge; +} RoverInstruction; + +#endif diff --git a/Control/src/main.cpp b/Control/src/main.cpp index cda14c6..8ea0695 100644 --- a/Control/src/main.cpp +++ b/Control/src/main.cpp @@ -11,6 +11,7 @@ #include #include #include "status.h" +#include "instruction.h" #pragma endregion #pragma region Enable extra debugging info for ESP32