Reproduce K64F lpticker failure using a pending overflow interrupt

Committer:
c1728p9
Date:
Sat Jun 03 01:28:31 2017 +0000
Revision:
0:ec50e23dc211
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
c1728p9 0:ec50e23dc211 1 #include "mbed.h"
c1728p9 0:ec50e23dc211 2 // For debugging only
c1728p9 0:ec50e23dc211 3 extern "C" {
c1728p9 0:ec50e23dc211 4 #include "fsl_rtc.h"
c1728p9 0:ec50e23dc211 5 }
c1728p9 0:ec50e23dc211 6
c1728p9 0:ec50e23dc211 7 DigitalOut led1(LED1);
c1728p9 0:ec50e23dc211 8
c1728p9 0:ec50e23dc211 9 int main() {
c1728p9 0:ec50e23dc211 10 led1 = 1;
c1728p9 0:ec50e23dc211 11
c1728p9 0:ec50e23dc211 12 // For debugging only
c1728p9 0:ec50e23dc211 13 CLOCK_EnableClock(kCLOCK_Rtc0);
c1728p9 0:ec50e23dc211 14 printf("Enabled interrupts: 0x%x\r\n", RTC->IER);
c1728p9 0:ec50e23dc211 15 printf("Pending interrupts: 0x%x\r\n", RTC->SR & 0x7);
c1728p9 0:ec50e23dc211 16
c1728p9 0:ec50e23dc211 17 set_time(0xFFFFFFFE);
c1728p9 0:ec50e23dc211 18
c1728p9 0:ec50e23dc211 19 while (true) {
c1728p9 0:ec50e23dc211 20 led1 = !led1;
c1728p9 0:ec50e23dc211 21 wait(1.0);
c1728p9 0:ec50e23dc211 22 }
c1728p9 0:ec50e23dc211 23 }
c1728p9 0:ec50e23dc211 24