Skip to content

Commit 2636bb4

Browse files
Przemyslaw Bidafabiobaltieri
authored andcommitted
net: openthread: priortize usec timer for openthread port.
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]>
1 parent 1c411cc commit 2636bb4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

modules/openthread/platform/alarm.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ void platformAlarmInit(void)
5858

5959
void platformAlarmProcess(otInstance *aInstance)
6060
{
61+
#if OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE
62+
if (timer_us_fired) {
63+
timer_us_fired = false;
64+
otPlatAlarmMicroFired(aInstance);
65+
}
66+
#endif
6167
if (timer_ms_fired) {
6268
timer_ms_fired = false;
6369
#if defined(CONFIG_OPENTHREAD_DIAG)
@@ -69,12 +75,6 @@ void platformAlarmProcess(otInstance *aInstance)
6975
otPlatAlarmMilliFired(aInstance);
7076
}
7177
}
72-
#if OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE
73-
if (timer_us_fired) {
74-
timer_us_fired = false;
75-
otPlatAlarmMicroFired(aInstance);
76-
}
77-
#endif
7878
}
7979

8080
uint32_t otPlatAlarmMilliGetNow(void)

0 commit comments

Comments
 (0)