mirror of
https://github.com/IcedRooibos/py32f0-template.git
synced 2025-10-28 16:32:05 -07:00
refactor: update default app
This commit is contained in:
parent
8813b261fa
commit
287cb3400c
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user