[BSP] Adjust RCC for stm32l412-st-nucleo BSP
This commit is contained in:
parent
ae724e447f
commit
db327dc2e6
@ -86,7 +86,7 @@ USB 虚拟 COM 端口默认连接串口 2,在终端工具里打开相应的串
|
||||
```bash
|
||||
\ | /
|
||||
- RT - Thread Operating System
|
||||
/ | \ 4.0.0 build Jan 9 2020
|
||||
/ | \ 4.0.3 build Apr 24 2020
|
||||
2006 - 2020 Copyright by rt-thread team
|
||||
msh >
|
||||
```
|
||||
|
@ -12,20 +12,20 @@
|
||||
#include <rtdevice.h>
|
||||
#include <board.h>
|
||||
|
||||
/* defined the LED0 pin: PB3 */
|
||||
#define LED0_PIN GET_PIN(B, 3)
|
||||
/* defined the LD4 pin: PB13 */
|
||||
#define LD4_PIN GET_PIN(B, 13)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int count = 1;
|
||||
/* set LED0 pin mode to output */
|
||||
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
|
||||
/* set LD4 pin mode to output */
|
||||
rt_pin_mode(LD4_PIN, PIN_MODE_OUTPUT);
|
||||
|
||||
while (count++)
|
||||
{
|
||||
rt_pin_write(LED0_PIN, PIN_HIGH);
|
||||
rt_pin_write(LD4_PIN, PIN_HIGH);
|
||||
rt_thread_mdelay(500);
|
||||
rt_pin_write(LED0_PIN, PIN_LOW);
|
||||
rt_pin_write(LD4_PIN, PIN_LOW);
|
||||
rt_thread_mdelay(500);
|
||||
}
|
||||
|
||||
|
@ -33,8 +33,7 @@ void SystemClock_Config(void)
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_MSI;
|
||||
RCC_OscInitStruct.PLL.PLLM = 1;
|
||||
RCC_OscInitStruct.PLL.PLLN = 16;
|
||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV7;
|
||||
RCC_OscInitStruct.PLL.PLLN = 40;
|
||||
RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2;
|
||||
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
|
Loading…
x
Reference in New Issue
Block a user