CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
plugin_log_bridge.cpp
Go to the documentation of this file.
1
11
12#include "cdc_log.h"
13
14#include <atomic>
15
16static const char* TAG = "PLUGIN";
17static std::atomic<void*> s_active_plugin{nullptr};
18
19extern "C" void plg_log_info(const char* msg) { LOG_I(TAG, "%s", msg ? msg : ""); }
20extern "C" void plg_log_warn(const char* msg) { LOG_W(TAG, "%s", msg ? msg : ""); }
21extern "C" void plg_log_error(const char* msg) { LOG_E(TAG, "%s", msg ? msg : ""); }
22
23extern "C" void plg_set_active_plugin(void* p) { s_active_plugin.store(p, std::memory_order_release); }
24extern "C" void* plg_get_active_plugin(void) { return s_active_plugin.load(std::memory_order_acquire); }
static const char * TAG
CDC Log: logging over TinyUSB CDC and UART.
#define LOG_W(tag, fmt,...)
Definition cdc_log.h:146
#define LOG_I(tag, fmt,...)
Definition cdc_log.h:147
#define LOG_E(tag, fmt,...)
Definition cdc_log.h:145
void plg_set_active_plugin(void *p)
void plg_log_warn(const char *msg)
void * plg_get_active_plugin(void)
void plg_log_error(const char *msg)
static std::atomic< void * > s_active_plugin
void plg_log_info(const char *msg)