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)
205205 return NULL ;
206206}
207207
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+
209211void _timer_tick_handler (void )
210212{
211213 if (!timer_initialized || list_is_empty (kcb -> timer_list ))
212214 return ;
213215
214216 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 */
216218 int expired_count = 0 ;
217219
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 ) {
220223 timer_t * t = (timer_t * ) kcb -> timer_list -> head -> next -> data ;
221224
222225 if (now >= t -> deadline_ticks ) {
You can’t perform that action at this time.
0 commit comments