/
ellersseer
/
MyCheat
Обзор
Документация
Войти
/
ellersseer
/
MyCheat
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
2
CI/CD
Аналитика
Безопасность
master
include/log_buffer.h
41 строка
910 B
Dmitry Zhiltsov
feat(log): Добавить временные метки в логах #TSKMCHT-5
20 фев 2026, 22:19
20 фев 2026, 22:19
ba5c458
Код
Авторство
О чём код?
#ifndef LOG_BUFFER_H #define LOG_BUFFER_H #include <Arduino.h> #include "config.h" // Forward declaration — full header included only in .cpp class AsyncEventSource; class LogCapture : public Print { public: void begin(); void setEventSource(AsyncEventSource* src); size_t write(uint8_t c) override; size_t write(const uint8_t* buf, size_t size) override; // Return full buffer content (oldest -> newest) String getContent() const; private: void pushLine(); void _writeCharLocked(char c); void _formatUptime(char* buf, size_t len); char _buffer[LOG_BUFFER_SIZE]; size_t _head = 0; size_t _count = 0; char _lineBuffer[256]; size_t _linePos = 0; SemaphoreHandle_t _mutex = nullptr; AsyncEventSource* _eventSource = nullptr; bool _ready = false; bool _atLineStart = true; }; extern LogCapture logCapture; #endif // LOG_BUFFER_H