mirror of
https://github.com/espressif/openthread.git
synced 2026-07-25 05:24:08 +00:00
[radio] introduce dedicated RadioTime types to clarify clock domain (#13268)
This commit introduces dedicated type definitions `otRadioTime64` (`RadioTime64`) and `otRadioTime32` (`RadioTime32`) to represent radio hardware microsecond timestamps. Key benefits and changes: - Self-Documenting Clock Domain: Transceiver hardware clocks operate in a distinct clock domain (`otPlatRadioGetNow()`) from core system timers (`TimerMilli::GetNow()`, `TimerMicro::GetNow()`). Using dedicated types prevents developers from accidentally passing core system time into radio scheduling APIs. - Explicit Rollover Handling: Introduced `IsRadioTimeStrictlyBefore()` to compare 32-bit radio timestamps using modulo serial arithmetic, cleanly accounting for `uint32_t` microsecond counter wrap-around. - Core Module Adoption: Updated `otRadioFrame::mTxInfo` / `mRxInfo`, `otPlatRadioGetNow()`, `otPlatRadioReceiveAt()`, `SubMac`, and `CslTxScheduler` to adopt the new radio time types.
This commit is contained in:
committed by
GitHub
parent
593fc53fcf
commit
4c44ff1edb
@@ -457,7 +457,7 @@ OT_TOOL_WEAK otError otPlatRadioEnableCsl(otInstance *, uint32_t, otShortAddress
|
||||
|
||||
OT_TOOL_WEAK otError otPlatRadioResetCsl(otInstance *) { return OT_ERROR_NONE; }
|
||||
|
||||
OT_TOOL_WEAK void otPlatRadioUpdateCslSampleTime(otInstance *, uint32_t) {}
|
||||
OT_TOOL_WEAK void otPlatRadioUpdateCslSampleTime(otInstance *, otRadioTime32) {}
|
||||
|
||||
OT_TOOL_WEAK uint8_t otPlatRadioGetCslAccuracy(otInstance *)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user