void rtc_isr(void) { struct tm open; struct tm close; struct tm *now; time_t time = rtc_time(); now = gmtime(&time); settings_getopen(&open); settings_getclose(&close); if (timcmp(now, &open)) { boom_open(); } else if (timcmp(now, &close)) { boom_close(); } /* The interrupt flag isn't cleared by hardware, we have to do it. */ rtc_clear_flag(RTC_SEC); }
void rtc_isr(void) { volatile uint32_t j = 0, c = 0; /* The interrupt flag isn't cleared by hardware, we have to do it. */ rtc_clear_flag(RTC_SEC); c = rtc_get_counter_val(); /* Display the current counter value in binary via USART1. for (j = 0; j < 32; j++) { if ((c & (0x80000000 >> j)) != 0) cdcacm_input('1'); else cdcacm_input('0'); } cdcacm_input('\r'); cdcacm_input('\n'); */ //printf("Current counter: %d \r\n", c); }