process to asinc

This commit is contained in:
Dmitry Borisenko
2020-08-25 18:36:05 +03:00
parent b1318de1dc
commit 532925756f
14 changed files with 382 additions and 388 deletions

30
src/Class/NotAsinc.cpp Normal file
View File

@@ -0,0 +1,30 @@
#include "Class/NotAsinc.h"
NotAsinc::NotAsinc(uint8_t size) {
this->items = new NotAsincItem[size];
this->size = size;
}
NotAsinc::~NotAsinc() {}
void NotAsinc::add(uint8_t i, NotAsincCb f, void* arg) {
this->items[i].cb = f;
this->items[i].cb_arg = arg;
this->items[i].is_used = true;
}
void NotAsinc::loop() {
if (this->items[task].is_used) {
handle(this->items[task].cb, this->items[task].cb_arg);
task = 0;
}
}
void NotAsinc::make(uint8_t task) {
this->task = task;
}
void NotAsinc::handle(NotAsincCb f, void* arg) {
f(arg);
}
NotAsinc* myNotAsincActions;