From 570c387db1dc045afb430e56e731e64b9eff79ae Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Mon, 4 Mar 2024 10:45:54 +0800 Subject: [PATCH] minor improvement --- Core/Inc/yunhorn_sts_prd_conf.h | 6 +++--- Core/Src/dma.c | 2 ++ Core/Src/stm32wlxx_it.c | 5 ++++- Core/Src/usart.c | 8 ++++++-- TOF/App/app_tof_vl53l0x_range.c | 2 +- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Core/Inc/yunhorn_sts_prd_conf.h b/Core/Inc/yunhorn_sts_prd_conf.h index 8f690ad..50b841b 100644 --- a/Core/Inc/yunhorn_sts_prd_conf.h +++ b/Core/Inc/yunhorn_sts_prd_conf.h @@ -232,9 +232,9 @@ -#define MajorVer 23U -#define MinorVer 11U -#define SubMinorVer 18U +#define MajorVer 24U +#define MinorVer 03U +#define SubMinorVer 04U #define FirmwareVersion 3U #define YUNHORN_STS_MAX_NVM_CFG_SIZE 64U #define YUNHORN_STS_AC_CODE_SIZE 20U diff --git a/Core/Src/dma.c b/Core/Src/dma.c index 366b255..c34a3c2 100644 --- a/Core/Src/dma.c +++ b/Core/Src/dma.c @@ -70,9 +70,11 @@ void MX_DMA_Init(void) // **** I2C2 // **** USART2 +#if 0 /* DMA1_Channel6_IRQn interrupt configuration */ HAL_NVIC_SetPriority(DMA1_Channel6_IRQn, 0, 0); HAL_NVIC_EnableIRQ(DMA1_Channel6_IRQn); +#endif /* DMA1_Channel7_IRQn interrupt configuration */ HAL_NVIC_SetPriority(DMA1_Channel7_IRQn, 0, 0); HAL_NVIC_EnableIRQ(DMA1_Channel7_IRQn); diff --git a/Core/Src/stm32wlxx_it.c b/Core/Src/stm32wlxx_it.c index e3545a0..3bb6950 100644 --- a/Core/Src/stm32wlxx_it.c +++ b/Core/Src/stm32wlxx_it.c @@ -76,8 +76,9 @@ extern DMA_HandleTypeDef hdma_i2c2_tx; //extern TIM_HandleTypeDef htim2; //extern TIM_HandleTypeDef htim16; extern DMA_HandleTypeDef hdma_usart2_tx; +#if 0 extern DMA_HandleTypeDef hdma_usart2_rx; - +#endif /* USER CODE BEGIN EV */ @@ -328,7 +329,9 @@ void DMA1_Channel6_IRQHandler(void) /* USER CODE BEGIN DMA1_Channel6_IRQn 0 */ /* USER CODE END DMA1_Channel6_IRQn 0 */ +#if 0 HAL_DMA_IRQHandler(&hdma_usart2_rx); +#endif /* USER CODE BEGIN DMA1_Channel6_IRQn 1 */ /* USER CODE END DMA1_Channel6_IRQn 1 */ diff --git a/Core/Src/usart.c b/Core/Src/usart.c index e62df72..f0e4467 100644 --- a/Core/Src/usart.c +++ b/Core/Src/usart.c @@ -28,8 +28,9 @@ UART_HandleTypeDef huart2; DMA_HandleTypeDef hdma_usart2_tx; +#if 0 DMA_HandleTypeDef hdma_usart2_rx; - +#endif /* USART2 init function */ void MX_USART2_UART_Init(void) @@ -135,6 +136,7 @@ void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle) __HAL_LINKDMA(uartHandle,hdmatx,hdma_usart2_tx); /* USART2_RX Init */ +#if 0 hdma_usart2_rx.Instance = DMA1_Channel6; hdma_usart2_rx.Init.Request = DMA_REQUEST_USART2_RX; hdma_usart2_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; @@ -155,7 +157,7 @@ void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle) } #endif __HAL_LINKDMA(uartHandle,hdmarx,hdma_usart2_rx); - +#endif /* USART2 interrupt Init */ HAL_NVIC_SetPriority(USART2_IRQn, 2, 0); HAL_NVIC_EnableIRQ(USART2_IRQn); @@ -184,7 +186,9 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle) /* USART2 DMA DeInit */ HAL_DMA_DeInit(uartHandle->hdmatx); +#if 0 HAL_DMA_DeInit(uartHandle->hdmarx); +#endif /* USART2 interrupt Deinit */ HAL_NVIC_DisableIRQ(USART2_IRQn); /* USER CODE BEGIN USART2_MspDeInit 1 */ diff --git a/TOF/App/app_tof_vl53l0x_range.c b/TOF/App/app_tof_vl53l0x_range.c index abac118..a2aca40 100644 --- a/TOF/App/app_tof_vl53l0x_range.c +++ b/TOF/App/app_tof_vl53l0x_range.c @@ -414,7 +414,7 @@ void STS_TOF_VL53L0X_Range_Process(void) sts_tof_distance_data[i] = (RangingMeasurementData.RangeStatus!=0)?STS_MAX_L0_RANGE:VL53L0XDevs[i].LeakyRange; } - HAL_Delay(5); + HAL_Delay(1); } // for i < MAX_TOF_COUNT if (sensor_data_ready != 0) {