Prepare main.cpp

vintagepc/version-and-build
D.R.racer 2021-04-14 10:11:46 +02:00 committed by DRracer
parent e77ac1ecd3
commit ec44ef5f23
1 changed files with 30 additions and 0 deletions

View File

@ -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() { int main() {
setup();
for(;;){
loop();
}
return 0; return 0;
} }