File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -205,18 +205,21 @@ static list_node_t *timer_find_node_by_id(uint16_t id)
205
205
return NULL ;
206
206
}
207
207
208
- /* Timer tick handler with batch processing */
208
+ /* Reduce timer batch processing size for tighter interrupt latency bounds */
209
+ #define TIMER_BATCH_SIZE 4
210
+
209
211
void _timer_tick_handler (void )
210
212
{
211
213
if (!timer_initialized || list_is_empty (kcb -> timer_list ))
212
214
return ;
213
215
214
216
uint32_t now = mo_ticks ();
215
- timer_t * expired_timers [8 ]; /* Batch process up to 8 timers per tick */
217
+ timer_t * expired_timers [TIMER_BATCH_SIZE ]; /* Smaller batch size */
216
218
int expired_count = 0 ;
217
219
218
- /* Collect all expired timers in one pass */
219
- while (!list_is_empty (kcb -> timer_list ) && expired_count < 8 ) {
220
+ /* Collect expired timers in one pass, limited to batch size */
221
+ while (!list_is_empty (kcb -> timer_list ) &&
222
+ expired_count < TIMER_BATCH_SIZE ) {
220
223
timer_t * t = (timer_t * ) kcb -> timer_list -> head -> next -> data ;
221
224
222
225
if (now >= t -> deadline_ticks ) {
You can’t perform that action at this time.
0 commit comments