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

Software edge detector for side-band pins the ICU cannot serve. More...

#include <stdint.h>
#include "ra8_attributes.h"
#include "ra8_err.h"
#include "ra8_esp_hosted_gpio_internal.h"
#include "ra8_icu_regs.h"
#include "ra8_log.h"
#include "ra8_pin_interface.h"
#include "ra8_port_constants.h"
#include "ra8_port_utils.h"
#include "tx_api.h"
Include dependency graph for ra8_esp_hosted_gpio_edge.c:

Go to the source code of this file.

Data Structures

struct  ra8_esp_hosted_gpio_edge_row
 One pin under software edge detection. More...

Typedefs

typedef struct ra8_esp_hosted_gpio_edge_row ra8_esp_hosted_gpio_edge_row_t

Enumerations

enum  ra8_esp_hosted_gpio_edge_const_t : uint8_t {
  k_ra8_esp_hosted_gpio_edge_low = 0U ,
  k_ra8_esp_hosted_gpio_edge_high = 1U ,
  k_ra8_esp_hosted_gpio_edge_one_row = 1U
}
 Named constants the detector needs beyond the shared limits. More...

Functions

bool priv_ra8_esp_hosted_gpio_edge_seen (uint8_t prev_level, uint8_t now_level, uint8_t sense)
 Decide whether two consecutive samples show the configured edge.
static uint8_t internal_find (ra8_port_pin_t pin)
 Find the row watching a pin.
static bool internal_sample (ra8_port_pin_t pin, uint8_t *out_level)
 Read one pin through the slice's injected pin interface.
static void internal_timer_expiry (ULONG arg)
 ThreadX expiry function: run one sampling pass.
static ra8_err_t internal_timer_arm (void)
 Create the shared periodic timer if it is not already running.
static ra8_err_t internal_timer_disarm (void)
 Delete the shared periodic timer if it is running.
uint8_t priv_ra8_esp_hosted_gpio_edge_count (void)
 Report how many pins are under software edge detection.
ra8_err_t priv_ra8_esp_hosted_gpio_set_edge_poll_ms (uint16_t period_ms)
 Set the sampling period the software edge detector runs at.
ra8_err_t priv_ra8_esp_hosted_gpio_edge_register (ra8_port_pin_t pin, uint8_t sense, void(*handler)(void *), void *arg)
 Take a pin under software edge detection.
ra8_err_t priv_ra8_esp_hosted_gpio_edge_unregister (ra8_port_pin_t pin)
 Drop a pin from software edge detection.
void priv_ra8_esp_hosted_gpio_edge_poll_once (void)
 Sample every polled row once and dispatch the edges seen.

Variables

static const char *const s_tag = "eh_edge"
 Log tag identifying lines emitted by the software edge detector.
static ra8_esp_hosted_gpio_edge_row_t s_rows [k_ra8_esp_hosted_gpio_row_max]
 Every pin currently under software edge detection.
static TX_TIMER s_timer
 The one periodic ThreadX timer shared by every polled row.
static bool s_timer_live
 True while s_timer has been created and not yet deleted.
static uint16_t s_poll_ms = (uint16_t)k_ra8_esp_hosted_gpio_poll_ms_default
 Sampling period in milliseconds, shared by every polled row.
static char s_tx_name_eh_edge [] = "eh_edge"
 Writable ThreadX object name for the eh_edge object.

Detailed Description

Software edge detector for side-band pins the ICU cannot serve.

Tag
[Ring 4 / PORT] {World: NS}

On this package the ICU external-interrupt inputs are concentrated on port 0, so of the Pmod1 side-band nets only one has a channel. The rest still have to raise the vendored callback, and this file is how: one periodic ThreadX timer samples every registered pin, compares each sample against the level stored from the previous pass, and calls the pin's handler when the configured edge appears.

This is a real detector with a worse latency bound, not a placeholder. The bound is exactly one sampling period – the port's edge_poll_ms, two milliseconds by default – plus the timer thread's own scheduling latency. That is acceptable for this link because the co-processor holds DATA_READY asserted until the host takes the frame and holds HANDSHAKE asserted until the chip select falls, so neither line produces a pulse the sampler can miss; it only produces a later response than an ICU channel would.

Why this lives beside ra8_esp_hosted_gpio.c rather than inside it
The eight vtable slots plus this detector overrun the project's thousand-line file cap, and the split falls on a real seam: the slots own the vendored calling convention, this file owns a table and a timer.
Since
0.1.0

Definition in file ra8_esp_hosted_gpio_edge.c.

Typedef Documentation

◆ ra8_esp_hosted_gpio_edge_row_t

Enumeration Type Documentation

◆ ra8_esp_hosted_gpio_edge_const_t

Named constants the detector needs beyond the shared limits.

The two sampled levels are named so the table's stored level reads as a level rather than as an anonymous zero or one, and the timer's name is length-checked against nothing – ThreadX only stores the pointer.

Invariant
k_ra8_esp_hosted_gpio_edge_low and k_ra8_esp_hosted_gpio_edge_high are the only levels the table ever stores.
k_ra8_esp_hosted_gpio_edge_one_row is the row-count delta of a single registration.
Example:
row->last_level = (uint8_t)k_ra8_esp_hosted_gpio_edge_low;
@ k_ra8_esp_hosted_gpio_edge_low
Sample read low.
See also
priv_ra8_esp_hosted_gpio_edge_seen
Since
0.1.0
Enumerator
k_ra8_esp_hosted_gpio_edge_low 

Sample read low.

k_ra8_esp_hosted_gpio_edge_high 

Sample read high.

k_ra8_esp_hosted_gpio_edge_one_row 

Rows one registration adds.

Definition at line 84 of file ra8_esp_hosted_gpio_edge.c.

Function Documentation

◆ internal_find()

uint8_t internal_find ( ra8_port_pin_t pin)
static

Find the row watching a pin.

Linear scan over a table of four; a scan cannot be indexed out of range and beats any structure at this size.

Parameters
[in]pinPacked pin to look for.
Returns
Row index, or k_ra8_esp_hosted_gpio_row_max when there is none.
Return values
k_ra8_esp_hosted_gpio_row_maxThe pin is not being sampled.
Precondition
The table is not being mutated concurrently.
pin is a packed RA8_PIN value.
Postcondition
No table state is modified.
The result indexes s_rows or equals the table length.
Note
Safe from timer context; a pure scan.
Since
0.1.0
NASA Power of 10 Compliance:
  • Rule 2: the loop is bounded by the compile-time table length.

Definition at line 227 of file ra8_esp_hosted_gpio_edge.c.

References k_ra8_esp_hosted_gpio_row_max, pin, and s_rows.

Referenced by priv_ra8_esp_hosted_gpio_edge_register(), and priv_ra8_esp_hosted_gpio_edge_unregister().

◆ internal_sample()

bool internal_sample ( ra8_port_pin_t pin,
uint8_t * out_level )
static

Read one pin through the slice's injected pin interface.

Folds the HAL's ra8_level_t onto the 0/1 the table stores, and reports read failure separately so the caller can leave the stored level alone rather than treat a failed read as a level change.

Parameters
[in]pinPacked pin to sample.
[out]out_levelReceives 0 or 1; untouched when the read fails.
Returns
Whether the read succeeded.
Return values
true*out_level holds the sampled level.
falseThe pin driver refused; *out_level is unchanged.
Precondition
out_level is non-null.
A pin interface is installed (one always is).
Postcondition
No pin state is modified.
A failed read writes nothing.
Note
Safe from timer context.
Since
0.1.0

Definition at line 262 of file ra8_esp_hosted_gpio_edge.c.

References ra8_pin_interface_t::ctx, k_ra8_esp_hosted_gpio_edge_high, k_ra8_esp_hosted_gpio_edge_low, k_ra8_level_high, k_ra8_level_low, k_ra8_ok, pin, priv_ra8_esp_hosted_gpio_pin_interface(), and ra8_pin_interface_t::read.

Referenced by priv_ra8_esp_hosted_gpio_edge_poll_once(), and priv_ra8_esp_hosted_gpio_edge_register().

◆ internal_timer_arm()

ra8_err_t internal_timer_arm ( void )
static

Create the shared periodic timer if it is not already running.

ThreadX takes the first expiry and the reschedule interval separately; both are the sampling period here, so the very first pass happens one period after the first registration rather than immediately. That is deliberate: the registration has just seeded every row's level from a live read, so a pass at tick zero could only report "no change".

Returns
ra8_err_t Error code.
Return values
k_ra8_okThe timer is running.
k_ra8_err_rtos_errorThreadX refused to create it.
Precondition
The ThreadX kernel is running.
s_poll_ms is non-zero.
Postcondition
On success s_timer_live is true.
A second call while the timer runs changes nothing.
Note
Not thread-safe with respect to the disarm helper.
Since
0.1.0

Definition at line 325 of file ra8_esp_hosted_gpio_edge.c.

References internal_timer_expiry(), k_ra8_err_rtos_error, k_ra8_ok, ra8_log_error_val, s_poll_ms, s_tag, s_timer, s_timer_live, s_tx_name_eh_edge, and TX_SUCCESS.

Referenced by priv_ra8_esp_hosted_gpio_edge_register(), and priv_ra8_esp_hosted_gpio_set_edge_poll_ms().

◆ internal_timer_disarm()

ra8_err_t internal_timer_disarm ( void )
static

Delete the shared periodic timer if it is running.

Called when the last row goes, so a torn-down port leaves no kernel object behind, and by the period setter so a new period can be re-armed.

Returns
ra8_err_t Error code.
Return values
k_ra8_okNo timer is running.
k_ra8_err_rtos_errorThreadX refused to delete it.
Precondition
The expiry function is not currently executing.
The ThreadX kernel is running when the timer is live.
Postcondition
On success s_timer_live is false.
A second call changes nothing.
Note
Not thread-safe with respect to the arm helper.
Since
0.1.0

Definition at line 367 of file ra8_esp_hosted_gpio_edge.c.

References k_ra8_err_rtos_error, k_ra8_ok, ra8_log_error_val, s_tag, s_timer, s_timer_live, and TX_SUCCESS.

Referenced by priv_ra8_esp_hosted_gpio_edge_unregister(), and priv_ra8_esp_hosted_gpio_set_edge_poll_ms().

◆ internal_timer_expiry()

void internal_timer_expiry ( ULONG arg)
static

ThreadX expiry function: run one sampling pass.

A one-line shim so the pass itself stays callable from a test without a kernel. It takes ThreadX's ULONG argument and discards it: the pass walks the whole table, so there is nothing per-timer to carry.

Parameters
[in]argThreadX expiry argument; unused.
Precondition
The table is initialised (statically, so always).
Row handlers do not block.
Postcondition
One sampling pass has completed.
The timer remains armed; it is periodic.
Note
Timer-thread context: no blocking, no allocation.
Since
0.1.0

Definition at line 295 of file ra8_esp_hosted_gpio_edge.c.

References priv_ra8_esp_hosted_gpio_edge_poll_once().

Referenced by internal_h_timer_start(), and internal_timer_arm().

◆ priv_ra8_esp_hosted_gpio_edge_count()

uint8_t priv_ra8_esp_hosted_gpio_edge_count ( void )
nodiscard

Report how many pins are under software edge detection.

Reads the table occupancy. Exists so the port and the tests can assert the detector's state – in particular that teardown emptied it – without reaching into the module's storage.

Returns
Occupied rows, 0 .. k_ra8_esp_hosted_gpio_row_max.
Return values
0No pin is polled; the periodic timer is not running.
Precondition
None; safe to call before any registration.
The caller tolerates a value a concurrent registration may stale.
Postcondition
No module state is modified.
The result never exceeds k_ra8_esp_hosted_gpio_row_max.
Note
Safe from interrupt context.
Example:
uint8_t priv_ra8_esp_hosted_gpio_edge_count(void)
Report how many pins are under software edge detection.
See also
priv_ra8_esp_hosted_gpio_edge_register
Since
0.1.0

Definition at line 381 of file ra8_esp_hosted_gpio_edge.c.

References k_ra8_esp_hosted_gpio_edge_one_row, k_ra8_esp_hosted_gpio_row_max, RA8_PRIV, and s_rows.

Referenced by priv_ra8_esp_hosted_gpio_edge_unregister().

◆ priv_ra8_esp_hosted_gpio_edge_poll_once()

void priv_ra8_esp_hosted_gpio_edge_poll_once ( void )

Sample every polled row once and dispatch the edges seen.

The body of the periodic timer, exposed so tests drive it directly rather than waiting on a kernel tick. For each occupied row it reads the pin through the injected pin interface, asks priv_ra8_esp_hosted_gpio_edge_seen whether the configured edge occurred, stores the new level and, when it did, calls the row's handler. A read that fails leaves the stored level untouched so a transient failure cannot manufacture an edge on the next pass.

Precondition
A pin interface is installed (one always is).
Row handlers do not block and do not re-enter this function.
Postcondition
Every occupied row's stored level matches its last good read.
One handler call was made per row that showed its configured edge.
Note
Runs from timer context in production; must not block.
MC/DC:
Decision: if (row->used && read_ok) (2 conditions). Vectors: used=T read_ok=T dispatches; used=F read_ok=T skips; used=T read_ok=F skips. Vectors 1+2 prove used influences the outcome independently, 1+3 do the same for read_ok: N+1 = 3 vectors.
Example:
void priv_ra8_esp_hosted_gpio_edge_poll_once(void)
Sample every polled row once and dispatch the edges seen.
See also
priv_ra8_esp_hosted_gpio_edge_seen
Since
0.1.0

Definition at line 467 of file ra8_esp_hosted_gpio_edge.c.

References ra8_esp_hosted_gpio_edge_row::arg, ra8_esp_hosted_gpio_edge_row::handler, internal_sample(), k_ra8_esp_hosted_gpio_edge_low, k_ra8_esp_hosted_gpio_row_max, ra8_esp_hosted_gpio_edge_row::last_level, ra8_esp_hosted_gpio_edge_row::pin, priv_ra8_esp_hosted_gpio_edge_seen(), RA8_PRIV, s_rows, ra8_esp_hosted_gpio_edge_row::sense, and ra8_esp_hosted_gpio_edge_row::used.

Referenced by internal_timer_expiry().

◆ priv_ra8_esp_hosted_gpio_edge_register()

ra8_err_t priv_ra8_esp_hosted_gpio_edge_register ( ra8_port_pin_t pin,
uint8_t sense,
void(* handler )(void *),
void * arg )
nodiscard

Take a pin under software edge detection.

Configures the pin as an input, records the level it starts at so the first sample cannot report a phantom edge, and arms the shared periodic timer if this is the first row. The row stores the vendored callback and its argument verbatim, so a polled pin and an ICU-served pin deliver identical calls.

Parameters
[in]pinPacked pin to watch; must be a legal RA8 pin.
[in]senseEdge selector using the ra8_icu_irqmd_t encoding: 0 falling, 1 rising, 2 both, 3 low level.
[in]handlerCallback invoked on a detected edge; must be non-null and must not block.
[in]argOpaque argument handed back to handler.
Returns
ra8_err_t Error code.
Return values
k_ra8_okThe pin is being sampled.
k_ra8_err_null_ptrhandler was null.
k_ra8_err_invalid_argsense was outside 0..3.
k_ra8_err_existsThe pin already has a row.
k_ra8_err_no_memThe table is full.
k_ra8_err_rtos_errorThe periodic timer would not arm.
k_ra8_err_gpio_conflictThe pin is owned by another module.
Precondition
The ThreadX kernel is running.
handler tolerates being called from timer context.
Postcondition
On success priv_ra8_esp_hosted_gpio_edge_count has grown by one.
On any failure no row is added and no pin is left claimed by this call.
Note
Not thread-safe with respect to the timer callback.
Warning
Detection latency is bounded by the sampling period, not by the pin: an edge shorter than one period can be missed entirely.
Example:
(void)priv_ra8_esp_hosted_gpio_edge_register(pin, 1U, gpio_hs_isr_handler, nullptr);
ra8_board_eth_pin_t pin
Pin.
ra8_err_t priv_ra8_esp_hosted_gpio_edge_register(ra8_port_pin_t pin, uint8_t sense, void(*handler)(void *), void *arg)
Take a pin under software edge detection.
See also
priv_ra8_esp_hosted_gpio_edge_unregister
Since
0.1.0

Definition at line 405 of file ra8_esp_hosted_gpio_edge.c.

References internal_find(), internal_sample(), internal_timer_arm(), k_ra8_err_exists, k_ra8_err_invalid_arg, k_ra8_err_no_mem, k_ra8_err_null_ptr, k_ra8_esp_hosted_gpio_edge_low, k_ra8_esp_hosted_gpio_row_max, k_ra8_icu_irqmd_low, k_ra8_ok, k_ra8_pull_none, pin, ra8_gpio_input_init(), ra8_gpio_release(), ra8_log_error_val, RA8_PRIV, s_rows, and s_tag.

Referenced by internal_config_gpio_as_interrupt().

◆ priv_ra8_esp_hosted_gpio_edge_seen()

bool priv_ra8_esp_hosted_gpio_edge_seen ( uint8_t prev_level,
uint8_t now_level,
uint8_t sense )
nodiscard

Decide whether two consecutive samples show the configured edge.

The whole decision logic of the software edge detector, kept pure so it can be driven exhaustively without hardware. Edge senses compare the two samples; the low-level sense is not an edge at all and reports on the current sample alone, which matches what the ICU does with k_ra8_icu_irqmd_low.

Parameters
[in]prev_levelLevel recorded by the previous sample: 0 or 1.
[in]now_levelLevel just read: 0 or 1.
[in]senseSelector using the ra8_icu_irqmd_t encoding: 0 falling, 1 rising, 2 both, 3 low level.
Returns
Whether the configured event is present.
Return values
trueThe handler should run.
falseNo event, or sense was outside 0..3.
Precondition
prev_level and now_level are 0 or 1.
sense uses the ICU encoding, not the vendored polarity flags.
Postcondition
No state is modified.
An out-of-range sense reports no event rather than guessing one.
Note
Pure function; safe from interrupt context.
MC/DC:
Every decision here is single-condition, so each needs two vectors: the range guard (sense=3 in range / sense=4 out of range), the level-sense test (sense=3 vs sense<3), the change test (prev==now / prev!=now), the both-edge test (sense=2 / sense!=2) and the rising test (sense=1 / sense=0). Sweeping all four senses across all four (prev, now) pairs covers every one of them.
Example:
if (priv_ra8_esp_hosted_gpio_edge_seen(0U, 1U, 1U)) { handler(arg); }
bool priv_ra8_esp_hosted_gpio_edge_seen(uint8_t prev_level, uint8_t now_level, uint8_t sense)
Decide whether two consecutive samples show the configured edge.
See also
priv_ra8_esp_hosted_gpio_edge_poll_once
Since
0.1.0

Definition at line 182 of file ra8_esp_hosted_gpio_edge.c.

References k_ra8_esp_hosted_gpio_edge_high, k_ra8_esp_hosted_gpio_edge_low, k_ra8_icu_irqmd_both, k_ra8_icu_irqmd_low, and k_ra8_icu_irqmd_rising.

Referenced by priv_ra8_esp_hosted_gpio_edge_poll_once().

◆ priv_ra8_esp_hosted_gpio_edge_unregister()

ra8_err_t priv_ra8_esp_hosted_gpio_edge_unregister ( ra8_port_pin_t pin)
nodiscard

Drop a pin from software edge detection.

Frees the row, releases the pin claim and, when the last row goes, deletes the shared periodic timer so a torn-down port leaves no kernel object running.

Parameters
[in]pinPacked pin previously passed to priv_ra8_esp_hosted_gpio_edge_register.
Returns
ra8_err_t Error code.
Return values
k_ra8_okThe row was freed.
k_ra8_err_not_foundThe pin had no row.
k_ra8_err_rtos_errorThe timer would not stop.
Precondition
The timer callback is not executing.
The pin was registered by this module.
Postcondition
priv_ra8_esp_hosted_gpio_edge_count has fallen by one.
The pin is no longer claimed by this module.
Note
Not thread-safe with respect to the timer callback.
Example:
ra8_err_t priv_ra8_esp_hosted_gpio_edge_unregister(ra8_port_pin_t pin)
Drop a pin from software edge detection.
See also
priv_ra8_esp_hosted_gpio_edge_register
Since
0.1.0

Definition at line 453 of file ra8_esp_hosted_gpio_edge.c.

References internal_find(), internal_timer_disarm(), k_ra8_err_not_found, k_ra8_esp_hosted_gpio_row_max, k_ra8_ok, pin, priv_ra8_esp_hosted_gpio_edge_count(), ra8_gpio_release(), RA8_PRIV, and s_rows.

Referenced by internal_teardown_gpio_interrupt().

◆ priv_ra8_esp_hosted_gpio_set_edge_poll_ms()

ra8_err_t priv_ra8_esp_hosted_gpio_set_edge_poll_ms ( uint16_t period_ms)
nodiscard

Set the sampling period the software edge detector runs at.

Applies to the single periodic ThreadX timer shared by every polled row. Changing it while rows are registered re-arms the timer, so the new period takes effect from the next expiry. The port passes ra8_esp_hosted_port_cfg_t::edge_poll_ms here during bring-up.

Parameters
[in]period_msSampling period in milliseconds; must be non-zero, because ThreadX rejects a zero-tick timer.
Returns
ra8_err_t Error code.
Return values
k_ra8_okThe period was accepted.
k_ra8_err_invalid_argperiod_ms was zero.
k_ra8_err_rtos_errorThe timer could not be re-armed.
Precondition
The ThreadX kernel is running when rows are already registered.
period_ms is small enough that an edge cannot be missed; the C6 holds DATA_READY asserted until the frame is taken, so any period shorter than a transaction is safe.
Postcondition
The detector's period reads back as period_ms.
No registered row is lost by the change.
Note
Not thread-safe; call from the port's bring-up path.
Example:
ra8_err_t priv_ra8_esp_hosted_gpio_set_edge_poll_ms(uint16_t period_ms)
Set the sampling period the software edge detector runs at.
See also
priv_ra8_esp_hosted_gpio_edge_poll_once
Since
0.1.0

Definition at line 392 of file ra8_esp_hosted_gpio_edge.c.

References internal_timer_arm(), internal_timer_disarm(), k_ra8_err_invalid_arg, k_ra8_ok, RA8_PRIV, s_poll_ms, and s_timer_live.

Referenced by internal_bring_up().

Variable Documentation

◆ s_poll_ms

uint16_t s_poll_ms = (uint16_t)k_ra8_esp_hosted_gpio_poll_ms_default
static

Sampling period in milliseconds, shared by every polled row.

The ThreadX tick on this board is 1 kHz, so the millisecond-to- tick conversion is the identity and this value is also the tick count.

Note
Written only by priv_ra8_esp_hosted_gpio_set_edge_poll_ms.
Warning
Zero is rejected at the setter; ThreadX refuses a zero-tick timer.
Since
0.1.0

Definition at line 166 of file ra8_esp_hosted_gpio_edge.c.

Referenced by internal_timer_arm(), and priv_ra8_esp_hosted_gpio_set_edge_poll_ms().

◆ s_rows

Every pin currently under software edge detection.

Statically sized (NASA Power of 10 Rule 3); a registration that does not fit is refused rather than allocated.

Note
Written by the registration pair and by the sampling pass.
Warning
Read from timer context; do not compact it while the timer runs.
Since
0.1.0

Definition at line 130 of file ra8_esp_hosted_gpio_edge.c.

Referenced by internal_find(), priv_ra8_esp_hosted_gpio_edge_count(), priv_ra8_esp_hosted_gpio_edge_poll_once(), priv_ra8_esp_hosted_gpio_edge_register(), and priv_ra8_esp_hosted_gpio_edge_unregister().

◆ s_tag

const char* const s_tag = "eh_edge"
static

Log tag identifying lines emitted by the software edge detector.

Distinct from the GPIO slice's own tag so a reader can tell a polled-path refusal from a slot-level one.

Note
Read-only after load.
Warning
Changing it breaks log filters that key on the string.
Since
0.1.0

Definition at line 59 of file ra8_esp_hosted_gpio_edge.c.

◆ s_timer

TX_TIMER s_timer
static

The one periodic ThreadX timer shared by every polled row.

One timer for the whole table rather than one per pin: the sampling pass is a handful of register reads, so a second timer would cost more than it saves.

Note
Created on the first registration, deleted with the last.
Warning
Firing it re-enters priv_ra8_esp_hosted_gpio_edge_poll_once; row handlers must therefore not block.
Since
0.1.0

Definition at line 143 of file ra8_esp_hosted_gpio_edge.c.

Referenced by internal_timer_arm(), and internal_timer_disarm().

◆ s_timer_live

bool s_timer_live
static

True while s_timer has been created and not yet deleted.

ThreadX has no "is this control block live" query, so the fact is tracked here; without it a second registration would try to create an already-created timer.

Note
Written only by the arm and disarm helpers.
Warning
Must never disagree with the kernel's view of s_timer.
Since
0.1.0

Definition at line 155 of file ra8_esp_hosted_gpio_edge.c.

Referenced by internal_timer_arm(), internal_timer_disarm(), and priv_ra8_esp_hosted_gpio_set_edge_poll_ms().

◆ s_tx_name_eh_edge

char s_tx_name_eh_edge[] = "eh_edge"
static

Writable ThreadX object name for the eh_edge object.

ThreadX takes object names as CHAR* rather than const CHAR*, so a string literal would have to be cast and would drop a qualifier the object really has. A writable array removes the cast instead of hiding it.

Note
Read by the create call only; ThreadX keeps the pointer.
Warning
Must outlive the object it names; file-scope storage does.
Since
0.1.0

Definition at line 179 of file ra8_esp_hosted_gpio_edge.c.

Referenced by internal_timer_arm().