stm32f103-template/applications/main.c

70 lines
1.3 KiB
C
Raw Permalink Normal View History

2023-05-09 22:30:49 +08:00
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2018-11-06 SummerGift first version
*/
#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>
2023-05-10 14:45:15 +08:00
// UART_HandleTypeDef huart4;
2023-05-09 22:30:49 +08:00
/* defined the LED0 pin: PB1 */
#define LED0_PIN GET_PIN(B, 1)
int main(void)
{
2023-05-10 14:45:15 +08:00
// MX_UART4_Init();
printf("Hello world!\n");
while (1)
2023-05-09 22:30:49 +08:00
{
2023-05-10 16:26:24 +08:00
rt_thread_delay(1000);
2023-05-10 14:45:15 +08:00
/* code */
2023-05-09 22:30:49 +08:00
}
2023-05-10 14:45:15 +08:00
2023-05-09 22:30:49 +08:00
return RT_EOK;
}
2023-05-10 14:45:15 +08:00
// /**
// * @brief UART4 Initialization Function
// * @param None
// * @retval None
// */
// static void MX_UART4_Init(void)
// {
// /* USER CODE BEGIN UART4_Init 0 */
// /* USER CODE END UART4_Init 0 */
// /* USER CODE BEGIN UART4_Init 1 */
// /* USER CODE END UART4_Init 1 */
// huart4.Instance = UART4;
// huart4.Init.BaudRate = 115200;
// huart4.Init.WordLength = UART_WORDLENGTH_8B;
// huart4.Init.StopBits = UART_STOPBITS_1;
// huart4.Init.Parity = UART_PARITY_NONE;
// huart4.Init.Mode = UART_MODE_TX_RX;
// huart4.Init.HwFlowCtl = UART_HWCONTROL_NONE;
// huart4.Init.OverSampling = UART_OVERSAMPLING_16;
// if (HAL_UART_Init(&huart4) != HAL_OK)
// {
// Error_Handler();
// }
// /* USER CODE BEGIN UART4_Init 2 */
// /* USER CODE END UART4_Init 2 */
// }