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.
Dependents: Freedman_v2 Nucleo_i2c_OLED_BME280_copy
Fork of mbed-src by
Diff: targets/hal/TARGET_Freescale/TARGET_K20XX/rtc.api.c
- Revision:
- 489:119543c9f674
- Parent:
- 445:3312ed629f01
--- a/targets/hal/TARGET_Freescale/TARGET_K20XX/rtc.api.c	Thu Mar 05 13:15:07 2015 +0000
+++ b/targets/hal/TARGET_Freescale/TARGET_K20XX/rtc.api.c	Thu Mar 12 14:30:49 2015 +0000
@@ -29,9 +29,15 @@
 
 void rtc_init(void) {
     init();
-
+    
     // Enable the oscillator
+#if defined (TARGET_K20D50M)
     RTC->CR |= RTC_CR_OSCE_MASK;
+#else
+    // Teensy3.1 requires 20pF MCU loading capacitors for 32KHz RTC oscillator
+    /* RTC->CR: SC2P=0,SC4P=1,SC8P=0,SC16P=1,CLKO=0,OSCE=1,UM=0,SUP=0,SPE=0,SWR=0 */
+    RTC->CR |= RTC_CR_OSCE_MASK |RTC_CR_SC16P_MASK | RTC_CR_SC4P_MASK; 
+#endif
 
     //Configure the TSR. default value: 1
     RTC->TSR = 1;
    