From 0a0df081fb84a7944dd25b8a758d94f8f0a14b34 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Wed, 14 Apr 2021 10:11:46 +0200 Subject: [PATCH] Prepare main.cpp --- src/main.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 33c14ce..cb84165 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,3 +1,33 @@ +#include "logic/mm_control.h" + +/// One-time setup of HW and SW components +/// Called before entering the loop() function +void setup(){ + +} + +/// Main loop of the firmware +/// Proposed architecture +/// checkMsgs(); +/// if(msg is command){ +/// activate command handling +/// } else if(msg is query){ +/// format response to query +/// } +/// StepCurrentCommand(); +/// StepMotors(); +/// StepLED(); +/// StepWhateverElseNeedsStepping(); +/// The idea behind the Step* routines is to keep each automaton non-blocking allowing for some “concurrency”. +/// Some FW components will leverage ISR to do their stuff (UART, motor stepping?, etc.) +void loop(){ + +} + int main() { + setup(); + for(;;){ + loop(); + } return 0; }