Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MMA8451Q TSI mbed
Fork of KL25Z-rtc_i2c-100 by
Diff: main.cpp
- Revision:
 - 1:c9bed9dbeed5
 - Parent:
 - 0:20719c1a48f7
 - Child:
 - 2:2d1f4fbbcbb6
 
--- a/main.cpp	Mon Mar 03 17:19:46 2014 +0000
+++ b/main.cpp	Mon Mar 03 17:26:22 2014 +0000
@@ -114,31 +114,12 @@
     StartTime = ctTime;                     //get time we started up
     BootTime = ctTime;                      //save boot time for later (RTC debug)
 
-    pc.baud(230400);
+    pc.baud(115200);
     initSplash();
     
-    //who caused the reset condition??
-    uint16_t resetReg = (RCM->SRS1 << 8) | RCM->SRS0;
-    pc.printf("CPU Reset Source> 1: 0x%02x   0: 0x%02x\r\n", resetReg >> 8, resetReg & 255); 
-
-    //initialize the USB serial port interrupt and thread pointer
-    pc.printf("Initializing Serial Port Rx Interrupt...   \r\n");
-    
-       //look for devices on i2c buses
+    //look for devices on i2c buses
     find_i2c(0);
     find_i2c(1);
-    //enMMA8491 = 0;
-    //get kl25z chip serial number and configuration ID registers
-    uint32_t idRegH = SIM->UIDMH;
-    uint32_t idRegM = SIM->UIDML;
-    uint32_t idRegL = SIM->UIDL;
-    pc.printf("KL25Z id: 0x%04x %08x %08x\r\n", idRegH, idRegM, idRegL);
-    uint32_t isSDIR = SIM->SDID;
-    if(gDebug > 1) pc.printf("CPU type:    0x%08x\r\n  Family:    %x\r\n  SubFamily: %x\r\n  Series:    %x\r\n  SRAM Size: %x\r\n  Revision:  %x\r\n  Die:       %02x\r\n  Package:   %x\r\n", 
-                   isSDIR, isSDIR >> 28, (isSDIR >> 24) & 15, (isSDIR >> 20) & 15, (isSDIR >> 16) & 15, (isSDIR >> 12) & 15, (isSDIR >> 7) & 0x3f, (isSDIR >> 0) & 15);
-    uint32_t isFCFG = SIM->FCFG1;
-    if(gDebug > 1) pc.printf("Flash size:  0x%08x\r\n  Size:      %x\r\n", isFCFG, (isFCFG >> 24) & 15);  
-
 
     //check to see if the RTC is operational.  
     //NOTE: bootloader must be MBED, not FRDMKL25Z. Otherwise pin PTC1 (J10-12) will not have a clock signal for the RTC
@@ -189,9 +170,12 @@
             //pc.printf("Date: %s   ", timebuf_dMyy);
             //pc.printf("Time: %s \n", timebuf_hms);
             rled = LED_OFF;
-            wait_ms(200);
+            wait_ms(100);
             gled = LED_OFF;
-            wait_ms(200);
+            rled = LED_ON;
+            wait_ms(100);
+            rled = LED_OFF;
+            wait_ms(100);
         }
     
     }
    