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: Hobbyking_Cheetah_Compact Hobbyking_Cheetah_Compact_DRV8323_14bit Hobbyking_Cheetah_Compact_DRV8323_V51_201907 HKC_MiniCheetah ... more
Fork of mbed-dev by
Diff: targets/TARGET_Freescale/TARGET_K20XX/rtc_api.c
- Revision:
- 175:af195413fb11
- Parent:
- 149:156823d33999
diff -r b96e65c34a4d -r af195413fb11 targets/TARGET_Freescale/TARGET_K20XX/rtc_api.c
--- a/targets/TARGET_Freescale/TARGET_K20XX/rtc_api.c Mon Oct 02 15:33:19 2017 +0100
+++ b/targets/TARGET_Freescale/TARGET_K20XX/rtc_api.c Wed Oct 11 12:45:49 2017 +0100
@@ -29,14 +29,14 @@
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;
+ RTC->CR |= RTC_CR_OSCE_MASK |RTC_CR_SC16P_MASK | RTC_CR_SC4P_MASK;
#endif
//Configure the TSR. default value: 1
@@ -78,11 +78,6 @@
// disable counter
RTC->SR &= ~RTC_SR_TCE_MASK;
- // we do not write 0 into TSR
- // to avoid invalid time
- if (t == 0)
- t = 1;
-
// write seconds
RTC->TSR = t;
