From a09c6a41ded59d9f19b019aef140233fc999cdb9 Mon Sep 17 00:00:00 2001 From: wangxujie Date: Wed, 25 Jun 2025 09:18:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=BD-=E6=B3=A8=E9=87=8A=E4=B9=B1?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Core/Src/main.c | 64 ++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/Core/Src/main.c b/Core/Src/main.c index 2948bb5..ada39df 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -65,9 +65,9 @@ void MX_FREERTOS_Init(void); /* USER CODE END 0 */ /** - * @brief The application entry point. - * @retval int - */ + * @brief The application entry point. + * @retval int + */ int main(void) { /* USER CODE BEGIN 1 */ @@ -119,22 +119,22 @@ int main(void) } /** - * @brief System Clock Configuration - * @retval None - */ + * @brief System Clock Configuration + * @retval None + */ void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; /** Configure the main internal regulator output voltage - */ + */ __HAL_RCC_PWR_CLK_ENABLE(); __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); /** Initializes the RCC Oscillators according to the specified parameters - * in the RCC_OscInitTypeDef structure. - */ + * in the RCC_OscInitTypeDef structure. + */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; @@ -149,9 +149,8 @@ void SystemClock_Config(void) } /** Initializes the CPU, AHB and APB buses clocks - */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK - |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; + */ + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; @@ -168,31 +167,32 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { if (CH438_1_INT_Pin == GPIO_Pin) { - // ch438_1_int_flag = 1; // 设置CH438_1的中断标志,用于中断处理函数中判断是否为CH438_1的中断请?? + // ch438_1_int_flag = 1; // 设置CH438_1的中断标志,用于中断处理函数中判断是否为CH438_1的中断请求 ch438_interrupt_handler_ch438_chip_1(); } if (CH438_2_INT_Pin == GPIO_Pin) { - // ch438_2_int_flag = 1; // 设置CH438_1的中断标志,用于中断处理函数中判断是否为CH438_1的中断请?? + // ch438_2_int_flag = 1; // 设置CH438_1的中断标志,用于中断处理函数中判断是否为CH438_2的中断请求 ch438_interrupt_handler_ch438_chip_2(); } } /* USER CODE END 4 */ /** - * @brief Period elapsed callback in non blocking mode - * @note This function is called when TIM4 interrupt took place, inside - * HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment - * a global variable "uwTick" used as application time base. - * @param htim : TIM handle - * @retval None - */ + * @brief Period elapsed callback in non blocking mode + * @note This function is called when TIM4 interrupt took place, inside + * HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment + * a global variable "uwTick" used as application time base. + * @param htim : TIM handle + * @retval None + */ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) { /* USER CODE BEGIN Callback 0 */ /* USER CODE END Callback 0 */ - if (htim->Instance == TIM4) { + if (htim->Instance == TIM4) + { HAL_IncTick(); } /* USER CODE BEGIN Callback 1 */ @@ -201,9 +201,9 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) } /** - * @brief This function is executed in case of error occurrence. - * @retval None - */ + * @brief This function is executed in case of error occurrence. + * @retval None + */ void Error_Handler(void) { /* USER CODE BEGIN Error_Handler_Debug */ @@ -215,14 +215,14 @@ void Error_Handler(void) /* USER CODE END Error_Handler_Debug */ } -#ifdef USE_FULL_ASSERT +#ifdef USE_FULL_ASSERT /** - * @brief Reports the name of the source file and the source line number - * where the assert_param error has occurred. - * @param file: pointer to the source file name - * @param line: assert_param error line source number - * @retval None - */ + * @brief Reports the name of the source file and the source line number + * where the assert_param error has occurred. + * @param file: pointer to the source file name + * @param line: assert_param error line source number + * @retval None + */ void assert_failed(uint8_t *file, uint32_t line) { /* USER CODE BEGIN 6 */