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

31
include/Class/NotAsinc.h Normal file
View File

@@ -0,0 +1,31 @@
#pragma once
#include <Arduino.h>
#include <stdint.h>
#include <functional>
typedef std::function<void(void*)> NotAsincCb;
struct NotAsincItem {
bool test;
NotAsincCb cb;
void * cb_arg;
volatile bool is_used = false;
};
class NotAsinc {
private:
uint8_t size;
uint8_t task = 0;
NotAsincItem* items = NULL;
void handle(NotAsincCb f, void* arg);
public:
NotAsinc(uint8_t size);
~NotAsinc();
void add(uint8_t i, NotAsincCb, void* arg);
void make(uint8_t task);
void loop();
};
extern NotAsinc* myNotAsincActions;

View File

@@ -84,6 +84,11 @@ enum TimerTask_t { WIFI_SCAN,
UDP_DB,
TEST };
enum notAsincActions {
ZERO,
do_UPGRADE,
};
enum ErrorType_t {
ET_NONE,
ET_FUNCTION,

View File

@@ -3,10 +3,6 @@
#include <Arduino.h>
#include "Global.h"
extern void addElement(String name);
extern void delAllElement();
extern void addItem(String name);
extern void delAllItems();
extern int getNewElementNumber(String file);
extern void do_getJsonListFromCsv();
extern String getJsonListFromCsv(String csvFile,int colum);
extern void do_delElement();
extern void delElement(String itemsFile, String itemsLine);

View File

@@ -211,7 +211,7 @@ extern void timerStop_();
extern void delTimer(String number);
extern int readTimer(int number);
extern void initUpdater();
extern void upgradeInit();
// widget
extern void createWidgetByType(String widget_name, String page_name, String page_number, String file, String topic);