mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
process to asinc
This commit is contained in:
31
include/Class/NotAsinc.h
Normal file
31
include/Class/NotAsinc.h
Normal 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;
|
||||
@@ -84,6 +84,11 @@ enum TimerTask_t { WIFI_SCAN,
|
||||
UDP_DB,
|
||||
TEST };
|
||||
|
||||
enum notAsincActions {
|
||||
ZERO,
|
||||
do_UPGRADE,
|
||||
};
|
||||
|
||||
enum ErrorType_t {
|
||||
ET_NONE,
|
||||
ET_FUNCTION,
|
||||
|
||||
@@ -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);
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user