mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
drivers/power/activity_governor.c: Fix timer can't start when meet very small pmtick.
This commit is contained in:
@@ -594,12 +594,16 @@ static void governor_timer(int domain)
|
|||||||
pdomstate->wdog = wd_create();
|
pdomstate->wdog = wd_create();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state < PM_SLEEP && !pdom->stay[pdom->state] &&
|
if (state < PM_SLEEP && !pdom->stay[pdom->state])
|
||||||
pmtick[state])
|
|
||||||
{
|
{
|
||||||
int delay = pmtick[state] + pdomstate->btime - clock_systimer();
|
int delay = pmtick[state] + pdomstate->btime - clock_systimer();
|
||||||
int left = wd_gettime(pdomstate->wdog);
|
int left = wd_gettime(pdomstate->wdog);
|
||||||
|
|
||||||
|
if (delay <= 0)
|
||||||
|
{
|
||||||
|
delay = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (!WDOG_ISACTIVE(pdomstate->wdog) || abs(delay - left) > PM_TIMER_GAP)
|
if (!WDOG_ISACTIVE(pdomstate->wdog) || abs(delay - left) > PM_TIMER_GAP)
|
||||||
{
|
{
|
||||||
wd_start(pdomstate->wdog, delay, governor_timer_cb, 0);
|
wd_start(pdomstate->wdog, delay, governor_timer_cb, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user