File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -324,6 +324,19 @@ void timer_update(void)
324324 // dependent time counters. The timer_update() function also forwards the
325325 // time remainder to the next up-count so that fractions of a millisecond
326326 // are not lost.
327+ //
328+ // Note: Calls to the function can be spread out by up to 640ms. Measure-
329+ // ments show the current gap in calls to timer_update() to be from less
330+ // than 1ms, typically 1 to 2ms, and rare gaps of up to 65ms. The function
331+ // will now add the correct number of milliseconds to the periodic_timer,
332+ // mqtt_timer, arp_timer, 100ms_timer, and second_counter. TIM1 is used as
333+ // the time base for the counters. TIM1 is configured to clock at 100KHz and
334+ // the counter will count to 64000 (640ms) before it resets. It is assumed
335+ // the main.c loop NEVER takes longer than 640ms before getting around to
336+ // calling timer_update(). If the counter does over-flow the time collected
337+ // can be in error in 640ms increments. The overall main loop design must
338+ // guarantee that this does not happen.
339+
327340
328341 uint16_t counter ;
329342 uint16_t time_ms ;
You can’t perform that action at this time.
0 commit comments