Skip to content

Commit

Permalink
net: openthread: priortize usec timer for openthread port.
Browse files Browse the repository at this point in the history
This commit prioritizes usec timer over msec. Doing so improves
CSL by helping scheduling timeslots on IEEE 802.15.4 with lower miss
rate.

Signed-off-by: Przemyslaw Bida <[email protected]>
  • Loading branch information
canisLupus1313 authored and fabiobaltieri committed Sep 12, 2022
1 parent 1c411cc commit 2636bb4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/openthread/platform/alarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ void platformAlarmInit(void)

void platformAlarmProcess(otInstance *aInstance)
{
#if OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE
if (timer_us_fired) {
timer_us_fired = false;
otPlatAlarmMicroFired(aInstance);
}
#endif
if (timer_ms_fired) {
timer_ms_fired = false;
#if defined(CONFIG_OPENTHREAD_DIAG)
Expand All @@ -69,12 +75,6 @@ void platformAlarmProcess(otInstance *aInstance)
otPlatAlarmMilliFired(aInstance);
}
}
#if OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE
if (timer_us_fired) {
timer_us_fired = false;
otPlatAlarmMicroFired(aInstance);
}
#endif
}

uint32_t otPlatAlarmMilliGetNow(void)
Expand Down

0 comments on commit 2636bb4

Please sign in to comment.