|
ether2ser 0.1.0
Ethernet <-> synchronous V.24 bridge firmware for RP2040 + W5500
|
#include <inttypes.h>#include <stdarg.h>#include <stdbool.h>#include <stdint.h>#include <stdio.h>#include <string.h>#include "common.h"#include "hardware/sync.h"
Go to the source code of this file.
Data Structures | |
| struct | log_entry_t |
| struct | global_log_state_t |
Macros | |
| #define | LOG_QUEUE_DEPTH 128U |
| #define | LOG_QUEUE_MASK (LOG_QUEUE_DEPTH - 1U) |
| #define | LOG_LINE_MAX 160U |
Functions | |
| static void | log_wake_core1 (void) |
| log_level_t | get_loglevel (void) |
| Get current global log level. | |
| void | set_loglevel (log_level_t level) |
| Set current global log level. | |
| void | log_write (log_level_t level, const char *fmt,...) |
| Emit one formatted log message if level is enabled. | |
| void | log_core1_drain (void) |
| uint32_t | log_take_dropped_count (void) |
| uint32_t | log_get_high_water_mark (void) |
| bool | log_take_emitted_flag (void) |
| Atomically read and clear "log emitted" flag. | |
Variables | |
| static global_log_state_t | global_logstate |
| #define LOG_QUEUE_MASK (LOG_QUEUE_DEPTH - 1U) |
| log_level_t get_loglevel | ( | void | ) |
Get current global log level.
Definition at line 61 of file log.c.
References global_log_state_t::current_log_level, and global_logstate.
Referenced by cat_loglevel_get(), cat_loglevel_set(), event_dispatch(), and main().

| void log_core1_drain | ( | void | ) |
Definition at line 115 of file log.c.
References global_logstate, global_log_state_t::head, log_entry_t::line, LOG_QUEUE_MASK, global_log_state_t::queue, and global_log_state_t::tail.
Referenced by core1_entry().

| uint32_t log_get_high_water_mark | ( | void | ) |
Definition at line 139 of file log.c.
References global_logstate, and global_log_state_t::high_water_mark.
Referenced by update_statistics().

| uint32_t log_take_dropped_count | ( | void | ) |
Definition at line 132 of file log.c.
References global_log_state_t::dropped, and global_logstate.
Referenced by update_statistics().

| bool log_take_emitted_flag | ( | void | ) |
Atomically read and clear "log emitted" flag.
Definition at line 144 of file log.c.
References global_logstate, and global_log_state_t::log_emitted.
Referenced by event_loop().

|
inlinestatic |
Definition at line 15 of file log.c.
Referenced by log_write().

| void log_write | ( | log_level_t | level, |
| const char * | fmt, | ||
| ... | |||
| ) |
Emit one formatted log message if level is enabled.
| level | Message level. |
| fmt | LOG_PLAIN-style format string. |
| ... | Format arguments. |
Definition at line 71 of file log.c.
References global_log_state_t::current_log_level, global_log_state_t::dropped, global_logstate, global_log_state_t::head, global_log_state_t::high_water_mark, log_entry_t::line, global_log_state_t::log_emitted, LOG_LEVEL_PLAIN, LOG_LINE_MAX, LOG_QUEUE_MASK, log_wake_core1(), global_log_state_t::queue, and global_log_state_t::tail.

| void set_loglevel | ( | log_level_t | level | ) |
Set current global log level.
| level | New log level. |
Definition at line 66 of file log.c.
References global_log_state_t::current_log_level, and global_logstate.
Referenced by cat_loglevel_set(), and init_app().

|
static |
Definition at line 54 of file log.c.
Referenced by get_loglevel(), log_core1_drain(), log_get_high_water_mark(), log_take_dropped_count(), log_take_emitted_flag(), log_write(), and set_loglevel().