добавил MQTT, не рабочая версия

This commit is contained in:
Dmitry Borisenko
2022-01-10 23:37:21 +01:00
parent b2ad5102d1
commit 3e558175f9
11 changed files with 558 additions and 2 deletions

30
src/classes/NotAsync.cpp Normal file
View File

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