From 0ffdc57fefe068e1ca2456fa35c266f1e3d3af7f Mon Sep 17 00:00:00 2001 From: Paul Staron Date: Tue, 2 Feb 2016 22:56:37 +0000 Subject: [PATCH 1/2] Update rtc_api.c --- .../targets/hal/TARGET_STM/TARGET_STM32L4/rtc_api.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L4/rtc_api.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L4/rtc_api.c index 61dfd2bb5e4..24cf8131265 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L4/rtc_api.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L4/rtc_api.c @@ -33,8 +33,6 @@ #include "mbed_error.h" -static int rtc_inited = 0; - static RTC_HandleTypeDef RtcHandle; void rtc_init(void) @@ -43,9 +41,6 @@ void rtc_init(void) RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; uint32_t rtc_freq = 0; - if (rtc_inited) return; - rtc_inited = 1; - RtcHandle.Instance = RTC; // Enable Power clock @@ -128,13 +123,15 @@ void rtc_free(void) RCC_OscInitStruct.LSIState = RCC_LSI_OFF; RCC_OscInitStruct.LSEState = RCC_LSE_OFF; HAL_RCC_OscConfig(&RCC_OscInitStruct); - - rtc_inited = 0; } int rtc_isenabled(void) { - return rtc_inited; + if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS){ + return 1; + } else { + return 0; + } } /* From f485a476f63f7f59739a94207bceb51db289a9cc Mon Sep 17 00:00:00 2001 From: Paul Staron Date: Thu, 11 Feb 2016 21:45:07 +0000 Subject: [PATCH 2/2] Update Teensy3_1 OS_CLOCK Corrected Teensy3_1 OS_CLOCK to 96MHz. --- libraries/rtos/rtx/TARGET_CORTEX_M/RTX_Conf_CM.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/rtos/rtx/TARGET_CORTEX_M/RTX_Conf_CM.c b/libraries/rtos/rtx/TARGET_CORTEX_M/RTX_Conf_CM.c index 68a8c2803c0..2fbc5337cb2 100755 --- a/libraries/rtos/rtx/TARGET_CORTEX_M/RTX_Conf_CM.c +++ b/libraries/rtos/rtx/TARGET_CORTEX_M/RTX_Conf_CM.c @@ -120,10 +120,10 @@ // Defines the timer clock value. // Default: 6000000 (6MHz) #ifndef OS_CLOCK -# if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) +# if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_TEENSY3_1) # define OS_CLOCK 96000000 -# elif defined(TARGET_LPC1347) || defined(TARGET_STM32F303VC) || defined(TARGET_LPC1549) || defined(TARGET_STM32F334R8) || defined(TARGET_STM32F334C8) || defined(TARGET_STM32F303RE) || defined(TARGET_TEENSY3_1) +# elif defined(TARGET_LPC1347) || defined(TARGET_STM32F303VC) || defined(TARGET_LPC1549) || defined(TARGET_STM32F334R8) || defined(TARGET_STM32F334C8) || defined(TARGET_STM32F303RE) # define OS_CLOCK 72000000 # elif defined(TARGET_STM32F303K8)