|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Adapter that forwards ra8_log bytes into an ra8_io stream. More...
#include "ra8_io_log.h"#include <stdint.h>#include "ra8_attributes.h"#include "ra8_check.h"#include "ra8_err.h"#include "ra8_io_stream.h"#include "ra8_log.h"Go to the source code of this file.
Functions | |
| static void | internal_io_log_byte (void *ctx, uint8_t byte) |
| Byte sink: write one log byte to the attached stream. | |
| ra8_err_t | ra8_io_log_attach (ra8_io_stream_t *s) |
| Route ra8_log output to a bound ra8_io stream. | |
| void | ra8_io_log_detach (void) |
| Restore the default ITM log backend. | |
Variables | |
| static const char *const | s_tag = "ra8_io_log" |
| Module log tag. | |
Adapter that forwards ra8_log bytes into an ra8_io stream.
Installs a ra8_log_byte_sink_fn_t that writes each log byte to a bound ra8_io_stream_t. The dependency runs the right way: ra8_core defines the sink callback type, ra8_io implements it.
Definition in file ra8_io_log.c.
|
static |
Byte sink: write one log byte to the attached stream.
Best-effort: a stream write error is ignored so a failing log destination never propagates an error into the logging call site.
| [in] | ctx | The attached ra8_io_stream_t (as a void cookie). |
| [in] | byte | Log byte to forward. |
Definition at line 52 of file ra8_io_log.c.
References RA8_INTERNAL, and ra8_io_stream_write().
Referenced by ra8_io_log_attach().
|
nodiscard |
Route ra8_log output to a bound ra8_io stream.
| [in] | s | Bound stream to receive log bytes (must out-live the redirect). |
| k_ra8_ok | Logging now flows to s. |
| k_ra8_err_null_ptr | s was NULL. |
| k_ra8_err_not_initialized | s has no sink bound. |
Definition at line 61 of file ra8_io_log.c.
References ra8_io_stream_t::iface, internal_io_log_byte(), k_ra8_err_not_initialized, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_log_set_byte_sink(), and s_tag.
Referenced by main().
| void ra8_io_log_detach | ( | void | ) |
Restore the default ITM log backend.
Clears any stream installed by ra8_io_log_attach.
Definition at line 71 of file ra8_io_log.c.
References ra8_log_set_byte_sink().
|
static |
Module log tag.
Definition at line 28 of file ra8_io_log.c.