fix forever loop

This commit is contained in:
2024-02-16 16:06:53 +03:00
parent a143dcf80d
commit a0ca86909d
2 changed files with 19 additions and 21 deletions

View File

@ -218,18 +218,9 @@ private:
volatile uint8_t currentSubBufferIndex; // Счетчик текущей позиции во вспомогательном буфере фронтов/спадов
struct FrontStorage { // Структура для хранения времени и направления фронта/спада
volatile uint32_t time; // Время
volatile bool dir; // Направление (true = ↑; false = ↓)
volatile FrontStorage* next; // Указатель на следующий связанный фронт/спад, или nullptr если конец
// Операторо присвоения
FrontStorage& operator= (FrontStorage& val) {
this->next = val.next;
this->time = val.time;
this->dir = val.dir;
return *this;
}
volatile uint32_t time = 0; // Время
volatile bool dir = false; // Направление (true = ↑; false = ↓)
volatile FrontStorage* next = nullptr; // Указатель на следующий связанный фронт/спад, или nullptr если конец
};
volatile FrontStorage* lastFront = nullptr; // Указатель последнего фронта/спада
volatile FrontStorage* firstUnHandledFront = nullptr; // Указатель первого необработанного фронта/спада