threads/low power: Proper time convertion
@@ -1459,13 +1459,14 @@ static void threads_idlethr(void *arg)
wakeup = proc_nextWakeup();
if (wakeup > TIMER_US2CYC(2000)) {
- wakeup = hal_cpuLowPower((wakeup + TIMER_US2CYC(500)) / 1000);
+ wakeup = hal_cpuLowPower((TIMER_CYC2US(wakeup) + TIMER_US2CYC(500)) / TIMER_US2CYC(1000));
#ifdef CPU_STM32
hal_spinlockSet(&threads_common.spinlock);
threads_common.jiffies += wakeup * 1000;
hal_spinlockClear(&threads_common.spinlock);
#endif
}
+
hal_cpuHalt();
}
}
