Reproduce K64F lpticker failure using a pending overflow interrupt

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 // For debugging only
00003 extern "C" {
00004 #include "fsl_rtc.h"
00005 }
00006 
00007 DigitalOut led1(LED1);
00008 
00009 int main() {
00010     led1 = 1;
00011 
00012     // For debugging only
00013     CLOCK_EnableClock(kCLOCK_Rtc0);
00014     printf("Enabled interrupts: 0x%x\r\n", RTC->IER);
00015     printf("Pending interrupts: 0x%x\r\n", RTC->SR & 0x7);
00016 
00017     set_time(0xFFFFFFFE);
00018 
00019     while (true) {
00020         led1 = !led1;
00021         wait(1.0);
00022     }
00023 }
00024