BLE transmit and receive success

This commit is contained in:
2025-06-26 01:41:18 +08:00
parent 331d7dedb7
commit 59f65128b0
29 changed files with 8421 additions and 7601 deletions

View File

@@ -100,15 +100,13 @@ int main(void)
MX_UART4_Init();
MX_TIM1_Init();
MX_TIM8_Init();
// MX_ThreadX_Init();
/* USER CODE BEGIN 2 */
HCBle_InitDMAReception();
HAL_Delay(200);
// HAL_Delay(200);
/* USER CODE END 2 */
// MX_ThreadX_Init();
MX_ThreadX_Init();
/* We should never get here as control is now taken by the scheduler */
@@ -117,16 +115,7 @@ int main(void)
while (1)
{
/* USER CODE END WHILE */
if(flag == 1)
{
HCBle_ExtractAndParseFrame();
flag = 0;
}
// Ŀǰ BLE<4C>Ľ<EFBFBD><C4BD>ջ<EFBFBD>û<EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ƿ<EFBFBD><C7B7>ʹ<EFBFBD><CDB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
HCBle_SendData("#{\"lat\":%.6f,\"lon\":%.6f,\"angle\":%.2f}\n",
23.123456, 113.654321, 95.0);
HAL_Delay(1000);
// HCBle_SendData("#{\"lat\":%.6f,\"lon\":%.6f,\"angle\":%.2f}\n",23.123456, 113.654321, 95.0);
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
@@ -195,7 +184,7 @@ void SystemClock_Config(void)
/**
* @brief Period elapsed callback in non blocking mode
* @note This function is called when TIM5 interrupt took place, inside
* @note This function is called when TIM6 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
@@ -206,7 +195,7 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
/* USER CODE BEGIN Callback 0 */
/* USER CODE END Callback 0 */
if (htim->Instance == TIM5)
if (htim->Instance == TIM6)
{
HAL_IncTick();
}