refactor: update default app

This commit is contained in:
IOsetting 2023-03-12 13:54:51 +08:00
parent 8813b261fa
commit 287cb3400c

View File

@ -1,3 +1,9 @@
/***
* Demo: LED Toggle
*
* PA0 ------> LED+
* GND ------> LED-
*/
#include "py32f0xx_bsp_printf.h" #include "py32f0xx_bsp_printf.h"
@ -8,7 +14,7 @@ int main(void)
HAL_Init(); HAL_Init();
APP_GPIO_Config(); APP_GPIO_Config();
BSP_USART_Config(); BSP_USART_Config();
printf("SystemClk:%ld\r\n", SystemCoreClock); printf("PY32F0xx LED Toggle Demo\r\nSystem Clock: %ld\r\n", SystemCoreClock);
while (1) while (1)
{ {
@ -28,7 +34,6 @@ static void APP_GPIO_Config(void)
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
} }