mbed library sources. Supersedes mbed-src.
Dependents: Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more
Diff: targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L072xZ/TARGET_DISCO_L072CZ_LRWAN1/system_clock.c
- Revision:
- 187:0387e8f68319
- Parent:
- 181:57724642e740
diff -r 707f6e361f3e -r 0387e8f68319 targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L072xZ/TARGET_DISCO_L072CZ_LRWAN1/system_clock.c
--- a/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L072xZ/TARGET_DISCO_L072CZ_LRWAN1/system_clock.c Fri Jun 22 16:45:37 2018 +0100
+++ b/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L072xZ/TARGET_DISCO_L072CZ_LRWAN1/system_clock.c Thu Sep 06 13:40:20 2018 +0100
@@ -29,7 +29,7 @@
*/
#include "stm32l0xx.h"
-#include "mbed_assert.h"
+#include "mbed_error.h"
/*!< Uncomment the following line if you need to relocate your vector Table in
Internal SRAM. */
@@ -58,7 +58,7 @@
* @param None
* @retval None
*/
-void SystemInit (void)
+void SystemInit(void)
{
/*!< Set MSION bit */
RCC->CR |= (uint32_t)0x00000100U;
@@ -115,8 +115,8 @@
if (SetSysClock_PLL_HSI() == 0)
#endif
{
- while(1) {
- MBED_ASSERT(1);
+ {
+ error("SetSysClock failed\n");
}
}
}
@@ -170,7 +170,7 @@
if (HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphClkInit) != HAL_OK) {
return 0; // FAIL
}
-
+
/* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */
RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; // 32 MHz
@@ -200,8 +200,7 @@
// Output clock on MCO1 pin(PA8) for debugging purpose
if (bypass == 0) { // Xtal used
HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_SYSCLK, RCC_MCODIV_2); // 16 MHz
- }
- else { // External clock used
+ } else { // External clock used
HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_SYSCLK, RCC_MCODIV_4); // 8 MHz
}
#endif
mbed official




