CMake (+VSCode)
This commit is contained in:
parent
01a3e1b6e5
commit
0159a9cb45
21 changed files with 1073 additions and 538 deletions
61
Src/main.c
61
Src/main.c
|
@ -1,20 +1,20 @@
|
|||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : main.c
|
||||
* @brief : Main program body
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2025 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
******************************************************************************
|
||||
* @file : main.c
|
||||
* @brief : Main program body
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2025 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
|
@ -55,13 +55,13 @@ void SystemClock_Config(void);
|
|||
|
||||
/* Private user code ---------------------------------------------------------*/
|
||||
/* USER CODE BEGIN 0 */
|
||||
void SendStr(char const *str)
|
||||
{
|
||||
while(*str) {
|
||||
LL_USART_ClearFlag_TC(USART1);
|
||||
LL_USART_TransmitData8(USART1, *str++);
|
||||
while (!LL_USART_IsActiveFlag_TC(USART1));
|
||||
}
|
||||
void SendStr(char const *str) {
|
||||
while (*str) {
|
||||
LL_USART_ClearFlag_TC(USART1);
|
||||
LL_USART_TransmitData8(USART1, *str++);
|
||||
while (!LL_USART_IsActiveFlag_TC(USART1))
|
||||
;
|
||||
}
|
||||
}
|
||||
/* USER CODE END 0 */
|
||||
|
||||
|
@ -109,10 +109,11 @@ int main(void)
|
|||
|
||||
/* Infinite loop */
|
||||
/* USER CODE BEGIN WHILE */
|
||||
while (1)
|
||||
{
|
||||
SendStr("Hello world!\r\n");
|
||||
LL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
|
||||
while (1) {
|
||||
SendStr("Hello world!\r\n");
|
||||
LL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
|
||||
LL_mDelay(500);
|
||||
|
||||
/* USER CODE END WHILE */
|
||||
|
||||
/* USER CODE BEGIN 3 */
|
||||
|
@ -172,8 +173,7 @@ void Error_Handler(void)
|
|||
/* USER CODE BEGIN Error_Handler_Debug */
|
||||
/* User can add his own implementation to report the HAL error return state */
|
||||
__disable_irq();
|
||||
while (1)
|
||||
{
|
||||
while (1) {
|
||||
}
|
||||
/* USER CODE END Error_Handler_Debug */
|
||||
}
|
||||
|
@ -189,8 +189,9 @@ void Error_Handler(void)
|
|||
void assert_failed(uint8_t *file, uint32_t line)
|
||||
{
|
||||
/* USER CODE BEGIN 6 */
|
||||
/* User can add his own implementation to report the file name and line number,
|
||||
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
|
||||
/* User can add his own implementation to report the file name and line
|
||||
number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file,
|
||||
line) */
|
||||
/* USER CODE END 6 */
|
||||
}
|
||||
#endif /* USE_FULL_ASSERT */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue