Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32L476 Update rtc_api.c #1523

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32L4/rtc_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@

#include "mbed_error.h"

static int rtc_inited = 0;

static RTC_HandleTypeDef RtcHandle;

void rtc_init(void)
Expand All @@ -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
Expand Down Expand Up @@ -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;
}
}

/*
Expand Down
4 changes: 2 additions & 2 deletions libraries/rtos/rtx/TARGET_CORTEX_M/RTX_Conf_CM.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@
// <i> Defines the timer clock value.
// <i> 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)
Expand Down