Skip to content

Commit

Permalink
fix(openthread): fix openthread alarm timer calculation remaining_us …
Browse files Browse the repository at this point in the history
…overflow issue
  • Loading branch information
xiaqilin committed Feb 21, 2024
1 parent 28ff8e3 commit 4d7e86e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/openthread/src/port/esp_openthread_alarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ void esp_openthread_alarm_deinit(void)
void esp_openthread_alarm_update(esp_openthread_mainloop_context_t *mainloop)
{
struct timeval *timeout = &mainloop->timeout;
int32_t remain_min_time_us = INT32_MAX;
int32_t remaining_us = 0;
int64_t remain_min_time_us = INT64_MAX;
int64_t remaining_us = 0;
if (s_is_ms_running) {
remaining_us = calculate_duration(s_alarm_ms, otPlatAlarmMilliGetNow()) * US_PER_MS;
if (remain_min_time_us > remaining_us) {
Expand Down

0 comments on commit 4d7e86e

Please sign in to comment.