Skip to content

Commit 5774b77

Browse files
authored
Merge pull request #150 from nielsonm236/Selectable-Pinout-and-PCF8574
Selectable pinout and pcf8574
2 parents 9bc1750 + 86a8c77 commit 5774b77

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

NetworkModule/timer.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)