19#ifndef PROTOCORE_LOGBUF_H
20#define PROTOCORE_LOGBUF_H
24#if PROTOCORE_ENABLE_LOGBUF
30#define PROTOCORE_LOG_DEBUG 0
31#define PROTOCORE_LOG_INFO 1
32#define PROTOCORE_LOG_WARN 2
33#define PROTOCORE_LOG_ERROR 3
36typedef void (*protocore_log_trap_fn)(uint8_t level,
const char *line);
57 protocore_log_trap_fn cb;
92extern LogbufVars LogbufV;
97 void (*
const reset)(uint8_t *work);
98 void (*
const put)(uint8_t *work);
99 void (*
const held)(uint8_t *work);
100 void (*
const at)(uint8_t *work);
101 void (*
const dump)(uint8_t *work);
102 void (*
const set_trap)(uint8_t *work);
107void protocore_logbuf_reset(uint8_t *work);
108void protocore_logbuf_put(uint8_t *work);
109void protocore_logbuf_held(uint8_t *work);
110void protocore_logbuf_at(uint8_t *work);
111void protocore_logbuf_dump(uint8_t *work);
112void protocore_logbuf_set_trap(uint8_t *work);
118static const LogbufNs Logbuf __attribute__((unused)) = {
119 .reset = protocore_logbuf_reset,
120 .put = protocore_logbuf_put,
121 .held = protocore_logbuf_held,
122 .at = protocore_logbuf_at,
123 .dump = protocore_logbuf_dump,
124 .set_trap = protocore_logbuf_set_trap,
136uint8_t *protocore_logbuf_span(
void);
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
#define PROTOCORE_END_DECLS