Ersa Wearable Platform
Embedded smartwatch firmware and application framework
Loading...
Searching...
No Matches
debug_log.h
Go to the documentation of this file.
1#pragma once
2#include <stdint.h>
3#include <stddef.h>
4
5namespace DebugLog {
7struct Record { uint32_t sequence; char text[240]; };
9void begin();
11void log(const char* format, ...) __attribute__((format(printf, 1, 2)));
13void tick();
15void setProtocolMode(bool enabled);
16// Copies oldest-to-newest records newer than cursor. Returns copied count and
17// advances cursor to the newest sequence observed, including records skipped
18// because the caller's buffer was smaller than the ring.
19size_t readSince(uint32_t cursor, Record* out, size_t capacity, uint32_t* nextCursor);
21uint32_t latestSequence();
23uint32_t bootCount();
25const char* resetReasonName();
27void flush();
28}
29
34#ifndef ERSA_VERBOSE_DIAGNOSTICS
35#define ERSA_VERBOSE_DIAGNOSTICS 0
36#endif
37
38#if ERSA_VERBOSE_DIAGNOSTICS
39#define ERSA_LOG_VERBOSE(...) DebugLog::log(__VA_ARGS__)
40#else
41#define ERSA_LOG_VERBOSE(...) ((void)0)
42#endif
Definition debug_log.h:5
size_t readSince(uint32_t cursor, Record *out, size_t capacity, uint32_t *nextCursor)
Definition debug_log.cpp:96
void begin()
Definition debug_log.cpp:59
void setProtocolMode(bool enabled)
Definition debug_log.cpp:90
uint32_t bootCount()
Definition debug_log.cpp:157
void flush()
Definition debug_log.cpp:153
const char * resetReasonName()
Definition debug_log.cpp:158
void void tick()
Definition debug_log.cpp:120
void log(const char *format,...) __attribute__((format(printf
Definition render.cpp:12
uint32_t latestSequence()
Definition debug_log.cpp:113
Definition debug_log.h:7
char text[240]
Definition debug_log.h:7
uint32_t sequence
Definition debug_log.h:7