mirror of
https://gitlab.com/wirelos/sprocket-lib.git
synced 2025-12-16 21:34:08 +01:00
pass scheduler to app
This commit is contained in:
24
src/Sprocket.cpp
Normal file
24
src/Sprocket.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "Sprocket.h"
|
||||
|
||||
Sprocket::Sprocket(){
|
||||
Serial.println("init sprocket");
|
||||
}
|
||||
|
||||
Sprocket* Sprocket::use(AppStack* stk){
|
||||
stack = stk;
|
||||
return this;
|
||||
}
|
||||
|
||||
Sprocket* Sprocket::addTask(Task& tsk){
|
||||
scheduler.addTask(tsk);
|
||||
tsk.enable();
|
||||
}
|
||||
|
||||
Sprocket* Sprocket::registerApp(App& app){
|
||||
app.activate(&scheduler);
|
||||
}
|
||||
|
||||
void Sprocket::loop(){
|
||||
scheduler.execute();
|
||||
//stack->loop();
|
||||
}
|
||||
Reference in New Issue
Block a user