откат изменений из-за потери оперативной памяти

This commit is contained in:
Dmitry Borisenko
2022-01-20 13:07:37 +01:00
parent 8229e0b116
commit c4a3dec67c
14 changed files with 18 additions and 301 deletions

View File

@@ -25,8 +25,6 @@
#define USE_LITTLEFS false
#endif
#define QUEUE_FROM_STR
//задачи таскера
enum TimerTask_t { WIFI_SCAN,
WIFI_MQTT_CONNECTION_CHECK,

View File

@@ -9,7 +9,3 @@
#include "classes/NotAsync.h"
#include "ESPConfiguration.h"
#include "MqttClient.h"
//#include "queue/QueueFromChar.h"
//#include "queue/QueueFromInstance.h"
//#include "queue/QueueInst.h"
#include "classes/QueueFromStruct.h"

View File

@@ -1,46 +0,0 @@
#pragma once
#include "Global.h"
#ifdef QUEUE_FROM_STR
#include <queue>
#include <iostream>
using namespace std;
struct QueueItems {
String myword;
uint8_t num;
};
class QueueFromStruct;
class QueueFromStruct {
public:
QueueFromStruct();
~QueueFromStruct();
void push(QueueItems word);
void pop();
QueueItems front();
bool empty();
private:
queue<QueueItems> queue1;
QueueItems tmpItem;
};
extern QueueFromStruct* filesQueue;
//=======проверка очереди из структур=================
// myQueueStruct = new QueueFromStruct;
// QueueItems myItem;
// myItem.myword = "word1";
// myQueueStruct->push(myItem);
// myItem.myword = "word2";
// myQueueStruct->push(myItem);
// myItem.myword = "word3";
// myQueueStruct->push(myItem);
// Serial.println(myQueueStruct->front().myword);
// Serial.println(myQueueStruct->front().myword);
// Serial.println(myQueueStruct->front().myword);
#endif

View File

@@ -1,6 +1,5 @@
#pragma once
#include "Global.h"
#include "classes/QueueFromStruct.h"
class SendJson;
@@ -9,7 +8,7 @@ class SendJson {
SendJson();
~SendJson();
void addFileToQueue(String path, uint8_t num);
void sendFile(String path, uint8_t num);
void loop();
@@ -17,13 +16,12 @@ class SendJson {
void sendMqtt(String& jsonArrayElement);
QueueItems myItem;
uint8_t _num;
private:
File file;
String _path;
uint8_t _num;
bool sendingInProgress = false;
};
extern SendJson* sendJsonFiles;
extern SendJson* sendConfigJson;
extern SendJson* sendWigdetsJson;

View File

@@ -1,42 +0,0 @@
#pragma once
#include "Global.h"
#ifdef QUEUE_FROM_CHAR
#define MAX_COMMAND_LENGTH 16
#define BUFFER 128
class QueueFromChar;
class QueueFromChar {
public:
QueueFromChar();
~QueueFromChar();
void addCommand(const char* command);
void printCommands();
String getLastCommand();
private:
struct CharBufferStruct {
char command[MAX_COMMAND_LENGTH + 1];
};
CharBufferStruct* commandList;
int commandCount = 0;
};
// extern QueueFromChar* myBuf;
//========проверка очереди=====================
// myBuf = new QueueFromChar;
// myBuf->addCommand("zero");
// myBuf->addCommand("one");
// myBuf->addCommand("two");
// myBuf->printCommands();
// myBuf->getLastCommand();
// myBuf->getLastCommand();
// myBuf->getLastCommand();
// myBuf->printCommands();
#endif

View File

@@ -1,26 +0,0 @@
#pragma once
#include "Global.h"
#ifdef QUEUE_FROM_INST
#include "classes/QueueInst.h"
#include <queue>
#include <iostream>
using namespace std;
class QueueFromInstance;
class QueueFromInstance {
public:
QueueFromInstance();
~QueueFromInstance();
void push(QueueInstance instance);
void pop();
QueueInstance front();
private:
queue<QueueInstance> queue1;
};
// extern QueueFromInstance* myQueue;
#endif

View File

@@ -1,19 +0,0 @@
#pragma once
#include "Global.h"
#include <queue>
#include <iostream>
using namespace std;
class QueueInstance;
class QueueInstance {
public:
QueueInstance(String text);
~QueueInstance();
String get();
private:
String _text;
};