Серьезно меняем скрипт обновления конфигурации проекта

This commit is contained in:
2022-08-02 23:32:11 +03:00
parent efcda0218a
commit 029d505806
55 changed files with 928 additions and 1399 deletions

View File

@@ -1,46 +0,0 @@
#ifdef QUEUE_FROM_CHAR
#include "classes/QueueFromChar.h"
QueueFromChar::QueueFromChar() {
commandList = NULL;
commandCount = 0;
}
QueueFromChar::~QueueFromChar() {}
//добавление команды в буфер
void QueueFromChar::addCommand(const char* command) {
commandList = (CharBufferStruct*)realloc(commandList, (commandCount + 1) * sizeof(CharBufferStruct));
strncpy(commandList[commandCount].command, command, MAX_COMMAND_LENGTH);
Serial.println("command added: " + String(command) + " " + String(commandCount));
commandCount++;
}
//распечатаем все добавленные команды
void QueueFromChar::printCommands() {
if (commandCount > 0 && commandList != NULL) {
for (int i = 0; i < commandCount; i++) {
Serial.println(commandList[i].command);
}
}
}
//заберем последнюю из положенных в буфер команд
String QueueFromChar::getLastCommand() {
String ret = "empty";
if (commandList != NULL) {
int cnt = commandCount - 1;
ret = commandList[cnt].command;
if (cnt > 0) {
delete commandList[cnt].command;
} else if (cnt == 0) {
commandList = NULL;
}
Serial.println("command deleted: " + ret + " " + String(cnt));
commandCount--;
}
return ret;
}
// QueueFromChar* myBuf;
#endif