timer: Proactive pull from FlashFloppy for coarse-deadline handling

Set the coarse deadline only 1ms early, as 1ms is sure to be within
range of 2^16 systicks (at up to approx 500MHz core clock).
This commit is contained in:
Keir Fraser
2023-07-14 14:18:28 +01:00
parent f3a0110eea
commit ca7447ceac

View File

@@ -52,7 +52,7 @@ static void reprogram_timer(int32_t delta)
* fine-grained deadline. */
tim->psc = sysclk_us(100)-1;
tim->arr = min_t(uint32_t, 0xffffu,
delta/time_us(100)-50); /* 5ms early */
delta/time_us(100)-10); /* 1ms early */
}
tim->egr = TIM_EGR_UG; /* update CNT, PSC, ARR */
tim->sr = 0; /* dummy write, gives hardware time to process EGR.UG=1 */