ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_log.c File Reference

Default log sink implementation. More...

#include "ra8_log.h"
#include <stdint.h>
#include "ra8_attributes.h"
#include "ra8_scb.h"
#include "ra8_err.h"
Include dependency graph for ra8_log.c:

Go to the source code of this file.

Data Structures

struct  ra8_err_name_entry_t
 Single (code, name) pair in the ra8_err_to_str() lookup table. More...

Enumerations

enum  ra8_itm_addr_t : uintptr_t {
  k_ra8_itm_stim_base = 0xE0000000UL ,
  k_ra8_itm_tcr_addr = 0xE0000E80UL ,
  k_ra8_itm_tenr_addr = 0xE0000E00UL
}
enum  ra8_log_u32_t : uint8_t {
  k_ra8_u32_max_digits = 10U ,
  k_ra8_decimal_base = 10U
}
 Emit an unsigned decimal integer over ITM port 0. More...

Functions

void ra8_log_set_byte_sink (ra8_log_byte_sink_fn_t fn, void *ctx)
 Install (or clear) an optional byte sink for log output.
static volatile uint32_t * internal_itm_stim0 (void)
 Get the ITM stimulus-port-0 register.
static volatile uint32_t * internal_itm_tcr (void)
 Get the ITM Trace Control Register.
static volatile uint32_t * internal_itm_tenr (void)
 Get the ITM Trace Enable Register.
static bool internal_itm_ready (void)
 Check whether ITM port 0 is enabled and ready to accept bytes.
static void internal_itm_putc (uint8_t byte)
 Blocking-but-bounded write of a single byte to ITM port 0.
static void internal_itm_puts (const char *s)
 Emit a NUL-terminated string over ITM port 0.
static void internal_itm_put_u32 (uint32_t value)
static void internal_itm_put_i32 (int32_t value)
 Emit a signed decimal integer over ITM port 0.
void ra8_log_init (void)
 Default log backend init – no-op for the ITM sink.
static void internal_emit_line (const char *level, const char *tag, const char *msg)
 Common tagged-line emit helper.
static void internal_emit_line_u (const char *level, const char *tag, const char *msg, uint32_t value)
 Common tagged-line-with-value emit helper (unsigned).
static void internal_emit_line_i (const char *level, const char *tag, const char *msg, int32_t value)
 Common tagged-line-with-value emit helper (signed).
void ra8_log_emit_error (const char *tag, const char *message)
 Emit an ERROR-level log line with only a tag and a message.
void ra8_log_emit_warn (const char *tag, const char *message)
 Emit a WARN-level log line with only a tag and a message.
void ra8_log_emit_info (const char *tag, const char *message)
 Emit an INFO-level log line with only a tag and a message.
void ra8_log_emit_debug (const char *tag, const char *message)
 Emit a DEBUG-level log line with only a tag and a message.
void ra8_log_emit_error_val (const char *tag, const char *message, uint32_t value)
 ERROR-level log emitter that also reports a uint32 value.
void ra8_log_emit_warn_val (const char *tag, const char *message, uint32_t value)
 WARN-level log emitter that also reports a uint32 value.
void ra8_log_emit_info_val (const char *tag, const char *message, uint32_t value)
 INFO-level log emitter that also reports a uint32 value.
void ra8_log_emit_debug_val (const char *tag, const char *message, int32_t value)
 DEBUG-level log emitter that also reports a signed int32 value.
const char * ra8_err_to_str (ra8_err_t err)
 Implementation of ra8_err_to_str() – linear-scan lookup.

Variables

static ra8_log_byte_sink_fn_t s_byte_sink = nullptr
 Active log byte sink, or nullptr to use the default ITM port.
static void * s_byte_sink_ctx = nullptr
 Opaque cookie passed back to s_byte_sink on every byte.
static const ra8_err_name_entry_t s_ra8_err_names []
 Lookup table backing ra8_err_to_str().
static const uint32_t s_ra8_err_names_count
 Number of entries in s_ra8_err_names.

Detailed Description

Default log sink implementation.

Minimal log backend for the bare-metal bring-up phase. Every log function is a weak symbol that writes a single line to the ARM Cortex-M85 ITM (Instrumented Trace Macrocell) stimulus port 0. With an attached J-Link the output shows up in SWV Console (e2 studio), JLinkRTTViewer, or JLinkSWOViewer without any extra wiring.

Why ITM:

  • Zero hardware setup beyond a single register write during init.
  • Works before any peripheral clock is up (it uses the CoreSight debug clock, not the CPU peripheral bus).
  • Non-blocking: if the debugger is not draining the FIFO the write is silently dropped – fine for a fire-and-forget logger.

A UART-backed log sink for boards without a J-Link can be plugged in later by overriding the ra8_log_emit_* functions with non-weak definitions elsewhere in the project.

Note
Format: "[TAG] level: message" followed by a newline. The *_val variants append " = <decimal>".

Definition in file ra8_log.c.

Enumeration Type Documentation

◆ ra8_itm_addr_t

enum ra8_itm_addr_t : uintptr_t
Enumerator
k_ra8_itm_stim_base 

ITM stimulus port 0 base.

k_ra8_itm_tcr_addr 

ITM Trace Control Register.

k_ra8_itm_tenr_addr 

ITM Trace Enable Register.

Definition at line 67 of file ra8_log.c.

◆ ra8_log_u32_t

enum ra8_log_u32_t : uint8_t

Emit an unsigned decimal integer over ITM port 0.

Hand-rolled itoa for uint32_t. Avoids snprintf (which would drag in vararg + nano stdio).

Parameters
[in]valueValue to emit.
Returns
None.
Return values
None
Precondition
Underlying MMIO is reachable – otherwise digits are dropped.
Caller has already emitted any prefix it wants.
Postcondition
Decimal digits of value (MSB-first) have been pushed.
No state modified.
Note
Always inlined. Bounded loop, NASA Rule 2 compliant.
Since
0.1.0
Enumerator
k_ra8_u32_max_digits 

Max decimal digits in a uint32_t.

k_ra8_decimal_base 

Decimal radix.

Definition at line 304 of file ra8_log.c.

Function Documentation

◆ internal_emit_line()

void internal_emit_line ( const char * level,
const char * tag,
const char * msg )
static

Common tagged-line emit helper.

Writes [tag] level: msg\r\n. Bails out early if the ITM backend is not ready.

Parameters
[in]levelString like "ERROR" or "INFO". Must be non-NULL.
[in]tagComponent tag. Must be non-NULL.
[in]msgFree-form message. Must be non-NULL.
Precondition
All three string parameters are non-NULL and NUL-terminated.
ra8_log_init() has run (otherwise dropped).
Postcondition
One log line is emitted (or dropped).
No internal state modified.
Note
Thread-safety inherited from the backend.
Since
0.1.0

Definition at line 405 of file ra8_log.c.

References internal_itm_putc(), internal_itm_puts(), internal_itm_ready(), and RA8_INTERNAL.

Referenced by ra8_log_emit_debug(), ra8_log_emit_error(), ra8_log_emit_info(), and ra8_log_emit_warn().

◆ internal_emit_line_i()

void internal_emit_line_i ( const char * level,
const char * tag,
const char * msg,
int32_t value )
static

Common tagged-line-with-value emit helper (signed).

Writes [tag] level: msg=<signed-decimal>\r\n.

Parameters
[in]levelString like "DEBUG". Must be non-NULL.
[in]tagComponent tag. Must be non-NULL.
[in]msgFree-form message. Must be non-NULL.
[in]valueSigned numeric companion value.
Precondition
All string parameters are non-NULL and NUL-terminated.
ra8_log_init() has run (otherwise dropped).
Postcondition
One log line is emitted (or dropped).
No internal state modified.
Note
Thread-safety inherited from the backend.
Since
0.1.0

Definition at line 481 of file ra8_log.c.

References internal_itm_put_i32(), internal_itm_putc(), internal_itm_puts(), and internal_itm_ready().

Referenced by ra8_log_emit_debug_val().

◆ internal_emit_line_u()

void internal_emit_line_u ( const char * level,
const char * tag,
const char * msg,
uint32_t value )
static

Common tagged-line-with-value emit helper (unsigned).

Writes [tag] level: msg=<decimal>\r\n.

Parameters
[in]levelString like "ERROR". Must be non-NULL.
[in]tagComponent tag. Must be non-NULL.
[in]msgFree-form message. Must be non-NULL.
[in]valueUnsigned numeric companion value.
Precondition
All string parameters are non-NULL and NUL-terminated.
ra8_log_init() has run (otherwise dropped).
Postcondition
One log line is emitted (or dropped).
No internal state modified.
Note
Thread-safety inherited from the backend.
Since
0.1.0

Definition at line 442 of file ra8_log.c.

References internal_itm_put_u32(), internal_itm_putc(), internal_itm_puts(), and internal_itm_ready().

Referenced by ra8_log_emit_error_val(), ra8_log_emit_info_val(), and ra8_log_emit_warn_val().

◆ internal_itm_put_i32()

void internal_itm_put_i32 ( int32_t value)
inlinestatic

Emit a signed decimal integer over ITM port 0.

Emits a leading - for negative values then forwards to internal_itm_put_u32. Negation goes through int64_t to avoid signed-overflow UB at INT32_MIN.

Parameters
[in]valueValue to emit.
Precondition
Underlying MMIO is reachable – otherwise dropped.
Caller has already emitted any prefix it wants.
Postcondition
Sign + decimal digits have been pushed.
No state modified.
Note
Always inlined.
Since
0.1.0

Definition at line 348 of file ra8_log.c.

References internal_itm_put_u32(), internal_itm_putc(), and RA8_INTERNAL.

Referenced by internal_emit_line_i().

◆ internal_itm_put_u32()

void internal_itm_put_u32 ( uint32_t value)
inlinestatic

◆ internal_itm_putc()

void internal_itm_putc ( uint8_t byte)
inlinestatic

Blocking-but-bounded write of a single byte to ITM port 0.

An installed byte sink takes the byte and the function returns. Otherwise, on target, polls the FIFO-ready bit up to k_ra8_itm_poll_limit times, then either writes the byte or gives up silently. Hosted (RA8_OFF_TARGET) builds compile that ITM fallback out entirely and drop the byte, so no host build holds a reference to a target MMIO address.

Parameters
[in]byteCharacter to emit.
Precondition
None – caller does not need to pre-check ready state.
On target, the underlying MMIO is mapped.
Postcondition
Either the byte has been pushed into the FIFO or the poll budget has been exhausted (drop).
No other state modified.
Note
Always inlined. Thread-safety is a backend concern.
Since
0.1.0

< RA8 itm poll limit.

Definition at line 229 of file ra8_log.c.

References internal_itm_stim0(), k_ra8_itm_stim_base, RA8_INTERNAL, s_byte_sink, and s_byte_sink_ctx.

Referenced by internal_emit_line(), internal_emit_line_i(), internal_emit_line_u(), internal_itm_put_i32(), internal_itm_put_u32(), and internal_itm_puts().

◆ internal_itm_puts()

void internal_itm_puts ( const char * s)
inlinestatic

Emit a NUL-terminated string over ITM port 0.

Walks s and forwards each byte through internal_itm_putc.

Parameters
[in]sString to emit (must be non-NULL).
Precondition
s is non-NULL and NUL-terminated.
Backend FIFO is reachable – otherwise bytes are dropped.
Postcondition
All bytes up to (excluding) the NUL have been pushed (or dropped).
No internal state modified.
Note
Always inlined. Not thread-safe across multiple writers.
Since
0.1.0

Definition at line 277 of file ra8_log.c.

References internal_itm_putc(), and RA8_INTERNAL.

Referenced by internal_emit_line(), internal_emit_line_i(), and internal_emit_line_u().

◆ internal_itm_ready()

bool internal_itm_ready ( void )
inlinestatic

Check whether ITM port 0 is enabled and ready to accept bytes.

Reads TCR, TENR, and the STIM0 FIFO register directly on target. Hosted builds use only an explicitly injected byte sink and otherwise report the backend unavailable, so a test never dereferences target-only addresses.

Returns
true if enabled and not full, false otherwise.
Return values
trueITMENA, port-0 enable, and FIFO-ready bits all set.
falseAny of the above is clear.
Precondition
None – pure read of architectural registers.
On target, the architectural ITM registers are addressable.
Postcondition
No state is modified.
Result reflects the registers at the moment of the call.
Note
Thread-safe (read-only). Always inlined.
Since
0.1.0

Definition at line 162 of file ra8_log.c.

References internal_itm_stim0(), internal_itm_tcr(), internal_itm_tenr(), RA8_INTERNAL, ra8_scb_trace_enabled(), and s_byte_sink.

Referenced by internal_emit_line(), internal_emit_line_i(), and internal_emit_line_u().

◆ internal_itm_stim0()

volatile uint32_t * internal_itm_stim0 ( void )
inlinestatic

Get the ITM stimulus-port-0 register.

Trivial address-cast helper. Always inlined.

Returns
Volatile pointer to the 32-bit stimulus FIFO.
Return values
(volatileuint32_t*)k_ra8_itm_stim_base
Precondition
None.
Underlying MMIO is mapped (always true on Cortex-M85).
Postcondition
No state modified.
Returned pointer remains valid for the program lifetime.
Note
Trivially thread-safe.
Since
0.1.0

Definition at line 91 of file ra8_log.c.

References k_ra8_itm_stim_base, RA8_HW_REGISTER_ACCESS, and RA8_INTERNAL.

Referenced by internal_itm_putc(), and internal_itm_ready().

◆ internal_itm_tcr()

volatile uint32_t * internal_itm_tcr ( void )
inlinestatic

Get the ITM Trace Control Register.

Trivial address-cast helper for the ITM TCR.

Returns
Volatile pointer to TCR.
Return values
(volatileuint32_t*)k_ra8_itm_tcr_addr
Precondition
None.
Underlying MMIO is mapped.
Postcondition
No state modified.
Returned pointer remains valid for the program lifetime.
Note
Trivially thread-safe.
Since
0.1.0

Definition at line 113 of file ra8_log.c.

References k_ra8_itm_tcr_addr, RA8_HW_REGISTER_ACCESS, and RA8_INTERNAL.

Referenced by internal_itm_ready().

◆ internal_itm_tenr()

volatile uint32_t * internal_itm_tenr ( void )
inlinestatic

Get the ITM Trace Enable Register.

Trivial address-cast helper for the ITM TENR.

Returns
Volatile pointer to TENR.
Return values
(volatileuint32_t*)k_ra8_itm_tenr_addr
Precondition
None.
Underlying MMIO is mapped.
Postcondition
No state modified.
Returned pointer remains valid for the program lifetime.
Note
Trivially thread-safe.
Since
0.1.0

Definition at line 135 of file ra8_log.c.

References k_ra8_itm_tenr_addr, RA8_HW_REGISTER_ACCESS, and RA8_INTERNAL.

Referenced by internal_itm_ready().

◆ ra8_err_to_str()

const char * ra8_err_to_str ( ra8_err_t err)

Implementation of ra8_err_to_str() – linear-scan lookup.

Human-readable string for an error code.

Walks s_ra8_err_names and returns the matching name. Returns the literal "unknown" if no entry matches.

Parameters
[in]errError code to look up.
Returns
Pointer to a static C string. Never NULL.
Return values
okReturned for k_ra8_ok.
<name>Returned for any known k_ra8_err_* code.
unknownReturned for any code not in the table.
Precondition
None – pure lookup.
Module-level table is populated at compile time.
Postcondition
No state modified.
Returned pointer remains valid for the program lifetime.
Note
Thread-safe (read-only walk of .rodata).
Since
0.1.0

Definition at line 737 of file ra8_log.c.

References s_ra8_err_names, and s_ra8_err_names_count.

Referenced by c6_cam_camera_report_last_error(), c6_fwver_phase_caps(), c6_fwver_phase_request(), c6_fwver_worker_entry(), c6_hosted_worker_entry(), c6_join_phase_ip(), c6_join_phase_ready(), c6_join_report_fault(), c6_join_worker_entry(), c6_wifi_phase_ready(), c6_wifi_report_fault(), c6_wifi_worker_entry(), internal_c6_cam_http_frame(), internal_c6_cam_join(), internal_c6_cam_prepare_camera(), internal_c6_cam_prepare_link(), internal_c6_cam_prepare_media(), internal_c6_cam_report_fault(), internal_c6_cam_worker_entry(), internal_fail(), internal_report_sccb_state(), sensor_report_register(), wifi_hal_report(), wifi_hal_run(), and wifi_hal_worker_entry().

◆ ra8_log_emit_debug()

void ra8_log_emit_debug ( const char * tag,
const char * message )

Emit a DEBUG-level log line with only a tag and a message.

Backend entry point for the ra8_log_debug() macro.

Parameters
[in]tagShort component tag; must not be NULL.
[in]messageFree-form ASCII message; must not be NULL.
Precondition
tag and message are NUL-terminated strings.
ra8_log_init() has run.
Postcondition
One log line emitted or dropped.
No caller-visible state modified.
Note
Thread-safety inherited from the backend.
Since
0.1.0

Definition at line 517 of file ra8_log.c.

References internal_emit_line().

◆ ra8_log_emit_debug_val()

void ra8_log_emit_debug_val ( const char * tag,
const char * message,
int32_t value )

DEBUG-level log emitter that also reports a signed int32 value.

Emit a DEBUG log line with an int32_t companion value.

Weak default backend. Forwards to internal_emit_line_i with the fixed level string "DEBUG".

Parameters
[in]tagNUL-terminated module tag.
[in]messageNUL-terminated short event description.
[in]valueint32 datum appended as "=NNN" (sign preserved).
Precondition
tag and message are non-NULL, NUL-terminated.
ra8_log_init() has run.
Postcondition
One line is emitted (or dropped).
No internal logger state is modified.
Note
Thread-safety inherited from the active backend.
Since
0.1.0

Definition at line 595 of file ra8_log.c.

References internal_emit_line_i().

◆ ra8_log_emit_error()

void ra8_log_emit_error ( const char * tag,
const char * message )

Emit an ERROR-level log line with only a tag and a message.

Backend entry point for the ra8_log_error() macro.

Parameters
[in]tagShort component tag; must not be NULL.
[in]messageFree-form ASCII message; must not be NULL.
Precondition
tag and message are NUL-terminated strings.
ra8_log_init() has run (otherwise dropped).
Postcondition
One log line emitted or dropped.
No caller-visible state modified.
Note
Thread-safety inherited from the backend.
Since
0.1.0

Definition at line 502 of file ra8_log.c.

◆ ra8_log_emit_error_val()

void ra8_log_emit_error_val ( const char * tag,
const char * message,
uint32_t value )

ERROR-level log emitter that also reports a uint32 value.

Emit an ERROR log line with a uint32_t companion value.

Weak default backend. Forwards to internal_emit_line_u with the fixed level string "ERROR".

Parameters
[in]tagNUL-terminated module tag (e.g. "ra8_log").
[in]messageNUL-terminated short event description.
[in]valueuint32 datum appended as "=NNN" to the line.
Precondition
tag and message are non-NULL, NUL-terminated.
ra8_log_init() has run (otherwise the line is silently dropped).
Postcondition
One line is emitted to the log backend (or dropped if backend down).
No internal logger state is modified.
Note
Thread-safety inherited from the active backend (ITM by default).
Since
0.1.0

Definition at line 538 of file ra8_log.c.

◆ ra8_log_emit_info()

void ra8_log_emit_info ( const char * tag,
const char * message )

Emit an INFO-level log line with only a tag and a message.

Backend entry point for the ra8_log_info() macro.

Parameters
[in]tagShort component tag; must not be NULL.
[in]messageFree-form ASCII message; must not be NULL.
Precondition
tag and message are NUL-terminated strings.
ra8_log_init() has run.
Postcondition
One log line emitted or dropped.
No caller-visible state modified.
Note
Thread-safety inherited from the backend.
Since
0.1.0

Definition at line 512 of file ra8_log.c.

References internal_emit_line().

◆ ra8_log_emit_info_val()

void ra8_log_emit_info_val ( const char * tag,
const char * message,
uint32_t value )

INFO-level log emitter that also reports a uint32 value.

Emit an INFO log line with a uint32_t companion value.

Weak default backend. Forwards to internal_emit_line_u with the fixed level string "INFO".

Parameters
[in]tagNUL-terminated module tag.
[in]messageNUL-terminated short event description.
[in]valueuint32 datum appended as "=NNN" to the line.
Precondition
tag and message are non-NULL, NUL-terminated.
ra8_log_init() has run.
Postcondition
One line is emitted (or dropped).
No internal logger state is modified.
Note
Thread-safety inherited from the active backend.
Since
0.1.0

Definition at line 576 of file ra8_log.c.

References internal_emit_line_u().

◆ ra8_log_emit_warn()

void ra8_log_emit_warn ( const char * tag,
const char * message )

Emit a WARN-level log line with only a tag and a message.

Backend entry point for the ra8_log_warn() macro.

Parameters
[in]tagShort component tag; must not be NULL.
[in]messageFree-form ASCII message; must not be NULL.
Precondition
tag and message are NUL-terminated strings.
ra8_log_init() has run.
Postcondition
One log line emitted or dropped.
No caller-visible state modified.
Note
Thread-safety inherited from the backend.
Since
0.1.0

Definition at line 507 of file ra8_log.c.

References internal_emit_line().

◆ ra8_log_emit_warn_val()

void ra8_log_emit_warn_val ( const char * tag,
const char * message,
uint32_t value )

WARN-level log emitter that also reports a uint32 value.

Emit a WARN log line with a uint32_t companion value.

Weak default backend. Forwards to internal_emit_line_u with the fixed level string "WARN".

Parameters
[in]tagNUL-terminated module tag.
[in]messageNUL-terminated short event description.
[in]valueuint32 datum appended as "=NNN" to the line.
Precondition
tag and message are non-NULL, NUL-terminated.
ra8_log_init() has run.
Postcondition
One line is emitted (or dropped).
No internal logger state is modified.
Note
Thread-safety inherited from the active backend.
Since
0.1.0

Definition at line 557 of file ra8_log.c.

References internal_emit_line_u().

◆ ra8_log_init()

void ra8_log_init ( void )

Default log backend init – no-op for the ITM sink.

Initialise the logging backend.

ITM is enabled by the debugger when it attaches; the firmware does not need to programme any control registers.

Precondition
Called exactly once during early boot.
Build either has a debugger attached or is the off-target host.
Postcondition
Subsequent log calls follow the ITM emit path.
No state modified – the function is intentionally empty.
Note
Thread-safety irrelevant – one-shot init only.
Since
0.1.0

Definition at line 379 of file ra8_log.c.

Referenced by internal_output_init(), main(), and ra8_infrastructure_init().

◆ ra8_log_set_byte_sink()

void ra8_log_set_byte_sink ( ra8_log_byte_sink_fn_t fn,
void * ctx )

Install (or clear) an optional byte sink for log output.

Pass a non-NULL fn to redirect all subsequent log bytes to fn; pass NULL to restore the default ITM backend. Off by default, so existing behaviour is unchanged until a sink is installed.

Parameters
[in]fnByte sink callback, or NULL to restore the ITM default.
[in]ctxOpaque cookie passed back to fn (may be NULL).
Returns
Nothing.
Precondition
None.
fn, when non-NULL, out-lives the redirect.
Postcondition
Subsequent log bytes route to fn (or ITM when fn is NULL).
No log line already in flight is rerouted mid-byte.
Note
Not thread-safe with respect to concurrent logging.
Since
0.1.0

Definition at line 56 of file ra8_log.c.

References s_byte_sink, and s_byte_sink_ctx.

Referenced by internal_output_init(), main(), main(), ra8_io_log_attach(), ra8_io_log_detach(), and ra8_nsc_periph_init().

Variable Documentation

◆ s_byte_sink

ra8_log_byte_sink_fn_t s_byte_sink = nullptr
static

Active log byte sink, or nullptr to use the default ITM port.

Warning
Set only through ra8_log_set_byte_sink.

Definition at line 47 of file ra8_log.c.

Referenced by internal_itm_putc(), internal_itm_ready(), and ra8_log_set_byte_sink().

◆ s_byte_sink_ctx

void* s_byte_sink_ctx = nullptr
static

Opaque cookie passed back to s_byte_sink on every byte.

Warning
Set only through ra8_log_set_byte_sink.

Definition at line 54 of file ra8_log.c.

Referenced by internal_itm_putc(), and ra8_log_set_byte_sink().

◆ s_ra8_err_names

const ra8_err_name_entry_t s_ra8_err_names[]
static

Lookup table backing ra8_err_to_str().

One row per k_ra8_err_* value defined in ra8_err.h. The table lives in .rodata (static const) and is scanned linearly by ra8_err_to_str(). Adding a new error code is a one-line addition here – no switch arm to update.

Note
The table order is informational only; ra8_err_to_str() does linear search so any order works. Keeping it in the same order as ra8_err_t makes diff review easier.
Warning
When a new code is added to ra8_err_t, this table MUST be extended in the same commit. The unit test tests/core/src/test_ra8_log.c walks every code so a missing entry fails CI.
Since
0.1.0

Definition at line 648 of file ra8_log.c.

Referenced by ra8_err_to_str().

◆ s_ra8_err_names_count

const uint32_t s_ra8_err_names_count
static
Initial value:
=
(uint32_t)(sizeof(s_ra8_err_names) / sizeof(s_ra8_err_names[0]))
static const ra8_err_name_entry_t s_ra8_err_names[]
Lookup table backing ra8_err_to_str().
Definition ra8_log.c:648

Number of entries in s_ra8_err_names.

Computed at compile time from sizeof so the table and loop bound stay in sync.

Since
0.1.0

Definition at line 712 of file ra8_log.c.

Referenced by ra8_err_to_str().