mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 03:07:21 +02:00
ble_mesh: fix ble mesh get timer remaining time
This commit is contained in:
@ -189,17 +189,5 @@ s32_t k_delayed_work_remaining_get(struct k_delayed_work *work)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!alarm->deadline_us) {
|
return osi_alarm_get_remaining_ms(alarm);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
s32_t remain_time = 0;
|
|
||||||
int64_t now = esp_timer_get_time();
|
|
||||||
if ((alarm->deadline_us - now) < 0x1FFFFFFFFFF) {
|
|
||||||
remain_time = (alarm->deadline_us - now) / 1000;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return remain_time;
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user