a tick counter
parent
39d17b4940
commit
5665f035c4
|
@ -37,6 +37,7 @@
|
|||
#include "rtc_ds1307.h" // RTC header and definitions
|
||||
|
||||
#if defined(SQUARE_WAVE_TICKS)
|
||||
volatile uint32_t rtc_ticks = 0;
|
||||
volatile bool rtc_tick_flag = false;
|
||||
#endif
|
||||
|
||||
|
@ -450,6 +451,7 @@ void SQUARE_WAVE_TIMER_ISR(void)
|
|||
{
|
||||
if (timer_get_flag(SQUARE_WAVE_TIMER, TIM_SR_UIF)) { // overflow even happened
|
||||
timer_clear_flag(SQUARE_WAVE_TIMER, TIM_SR_UIF); // clear flag
|
||||
rtc_ticks++; // increment count
|
||||
rtc_tick_flag = true; // update flag
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,8 @@
|
|||
/** @} */
|
||||
|
||||
#if defined(SQUARE_WAVE_TICKS)
|
||||
extern volatile bool rtc_tick_flag; /**< set on SQUARE_WAVE_TICS square wave tics */
|
||||
extern volatile uint32_t rtc_ticks; /**< increment on SQUARE_WAVE_TICS square wave ticks */
|
||||
extern volatile bool rtc_tick_flag; /**< set on SQUARE_WAVE_TICS square wave ticks */
|
||||
#endif
|
||||
|
||||
/** @brief setup communication with RTC IC
|
||||
|
|
Loading…
Reference in New Issue