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.
main.cpp
00001 #include "mbed.h" 00002 00003 DigitalOut myled(PB_12); 00004 00005 void SystemClock_Config(void) 00006 { 00007 RCC_OscInitTypeDef RCC_OscInitStruct; 00008 RCC_ClkInitTypeDef RCC_ClkInitStruct; 00009 00010 RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; 00011 RCC_OscInitStruct.HSEState = RCC_HSE_ON; 00012 RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; 00013 RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; 00014 RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6; 00015 RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1; 00016 HAL_RCC_OscConfig(&RCC_OscInitStruct); 00017 00018 RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK; 00019 RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; 00020 RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; 00021 RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; 00022 HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1); 00023 00024 SystemCoreClockUpdate(); 00025 } 00026 00027 int main() { 00028 00029 //SystemClock_Config(); 00030 00031 printf("SystemCoreClock = %d Hz\n\r", SystemCoreClock); 00032 00033 while(1) { 00034 myled = !myled; 00035 wait(0.5); 00036 } 00037 }
Generated on Sat Jul 23 2022 15:33:21 by
1.7.2