minor improvement

This commit is contained in:
Yunhorn 2024-03-04 10:45:54 +08:00
parent 6ca663507c
commit 570c387db1
5 changed files with 16 additions and 7 deletions

View File

@ -232,9 +232,9 @@
#define MajorVer 23U #define MajorVer 24U
#define MinorVer 11U #define MinorVer 03U
#define SubMinorVer 18U #define SubMinorVer 04U
#define FirmwareVersion 3U #define FirmwareVersion 3U
#define YUNHORN_STS_MAX_NVM_CFG_SIZE 64U #define YUNHORN_STS_MAX_NVM_CFG_SIZE 64U
#define YUNHORN_STS_AC_CODE_SIZE 20U #define YUNHORN_STS_AC_CODE_SIZE 20U

View File

@ -70,9 +70,11 @@ void MX_DMA_Init(void)
// **** I2C2 // **** I2C2
// **** USART2 // **** USART2
#if 0
/* DMA1_Channel6_IRQn interrupt configuration */ /* DMA1_Channel6_IRQn interrupt configuration */
HAL_NVIC_SetPriority(DMA1_Channel6_IRQn, 0, 0); HAL_NVIC_SetPriority(DMA1_Channel6_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(DMA1_Channel6_IRQn); HAL_NVIC_EnableIRQ(DMA1_Channel6_IRQn);
#endif
/* DMA1_Channel7_IRQn interrupt configuration */ /* DMA1_Channel7_IRQn interrupt configuration */
HAL_NVIC_SetPriority(DMA1_Channel7_IRQn, 0, 0); HAL_NVIC_SetPriority(DMA1_Channel7_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(DMA1_Channel7_IRQn); HAL_NVIC_EnableIRQ(DMA1_Channel7_IRQn);

View File

@ -76,8 +76,9 @@ extern DMA_HandleTypeDef hdma_i2c2_tx;
//extern TIM_HandleTypeDef htim2; //extern TIM_HandleTypeDef htim2;
//extern TIM_HandleTypeDef htim16; //extern TIM_HandleTypeDef htim16;
extern DMA_HandleTypeDef hdma_usart2_tx; extern DMA_HandleTypeDef hdma_usart2_tx;
#if 0
extern DMA_HandleTypeDef hdma_usart2_rx; extern DMA_HandleTypeDef hdma_usart2_rx;
#endif
/* USER CODE BEGIN EV */ /* USER CODE BEGIN EV */
@ -328,7 +329,9 @@ void DMA1_Channel6_IRQHandler(void)
/* USER CODE BEGIN DMA1_Channel6_IRQn 0 */ /* USER CODE BEGIN DMA1_Channel6_IRQn 0 */
/* USER CODE END DMA1_Channel6_IRQn 0 */ /* USER CODE END DMA1_Channel6_IRQn 0 */
#if 0
HAL_DMA_IRQHandler(&hdma_usart2_rx); HAL_DMA_IRQHandler(&hdma_usart2_rx);
#endif
/* USER CODE BEGIN DMA1_Channel6_IRQn 1 */ /* USER CODE BEGIN DMA1_Channel6_IRQn 1 */
/* USER CODE END DMA1_Channel6_IRQn 1 */ /* USER CODE END DMA1_Channel6_IRQn 1 */

View File

@ -28,8 +28,9 @@
UART_HandleTypeDef huart2; UART_HandleTypeDef huart2;
DMA_HandleTypeDef hdma_usart2_tx; DMA_HandleTypeDef hdma_usart2_tx;
#if 0
DMA_HandleTypeDef hdma_usart2_rx; DMA_HandleTypeDef hdma_usart2_rx;
#endif
/* USART2 init function */ /* USART2 init function */
void MX_USART2_UART_Init(void) void MX_USART2_UART_Init(void)
@ -135,6 +136,7 @@ void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle)
__HAL_LINKDMA(uartHandle,hdmatx,hdma_usart2_tx); __HAL_LINKDMA(uartHandle,hdmatx,hdma_usart2_tx);
/* USART2_RX Init */ /* USART2_RX Init */
#if 0
hdma_usart2_rx.Instance = DMA1_Channel6; hdma_usart2_rx.Instance = DMA1_Channel6;
hdma_usart2_rx.Init.Request = DMA_REQUEST_USART2_RX; hdma_usart2_rx.Init.Request = DMA_REQUEST_USART2_RX;
hdma_usart2_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; hdma_usart2_rx.Init.Direction = DMA_PERIPH_TO_MEMORY;
@ -155,7 +157,7 @@ void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle)
} }
#endif #endif
__HAL_LINKDMA(uartHandle,hdmarx,hdma_usart2_rx); __HAL_LINKDMA(uartHandle,hdmarx,hdma_usart2_rx);
#endif
/* USART2 interrupt Init */ /* USART2 interrupt Init */
HAL_NVIC_SetPriority(USART2_IRQn, 2, 0); HAL_NVIC_SetPriority(USART2_IRQn, 2, 0);
HAL_NVIC_EnableIRQ(USART2_IRQn); HAL_NVIC_EnableIRQ(USART2_IRQn);
@ -184,7 +186,9 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle)
/* USART2 DMA DeInit */ /* USART2 DMA DeInit */
HAL_DMA_DeInit(uartHandle->hdmatx); HAL_DMA_DeInit(uartHandle->hdmatx);
#if 0
HAL_DMA_DeInit(uartHandle->hdmarx); HAL_DMA_DeInit(uartHandle->hdmarx);
#endif
/* USART2 interrupt Deinit */ /* USART2 interrupt Deinit */
HAL_NVIC_DisableIRQ(USART2_IRQn); HAL_NVIC_DisableIRQ(USART2_IRQn);
/* USER CODE BEGIN USART2_MspDeInit 1 */ /* USER CODE BEGIN USART2_MspDeInit 1 */

View File

@ -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; 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 } // for i < MAX_TOF_COUNT
if (sensor_data_ready != 0) { if (sensor_data_ready != 0) {