From 18870b41f223830320677daeb84845ad4bd2b706 Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Mon, 14 Oct 2024 16:34:15 +0800 Subject: [PATCH] ** L8 ** prototype workable & stable --- Core/Src/main.c | 7 ++++--- Core/Src/sys_app.c | 2 +- LoRaWAN/App/app_lorawan.c | 4 ++-- TOF/App/app_tof.c | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Core/Src/main.c b/Core/Src/main.c index 49e4b8a..231eb2f 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -94,12 +94,13 @@ int main(void) /* Initialize all configured peripherals */ MX_I2C2_Init(); MX_GPIO_Init(); - MX_USART2_UART_Init(); + MX_LoRaWAN_Init(); /* USER CODE BEGIN 2 */ - MX_TOF_Init(); + MX_USART2_UART_Init(); + /* USER CODE END 2 */ /* Infinite loop */ @@ -109,7 +110,7 @@ int main(void) { /* USER CODE END WHILE */ - MX_TOF_Process(); + MX_TOF_Process(); MX_LoRaWAN_Process(); /* USER CODE BEGIN 3 */ diff --git a/Core/Src/sys_app.c b/Core/Src/sys_app.c index f982e84..38b31f5 100644 --- a/Core/Src/sys_app.c +++ b/Core/Src/sys_app.c @@ -120,7 +120,7 @@ void SystemApp_Init(void) /*Initialize the Sensors */ EnvSensors_Init(); - //MX_TOF_Init(); + MX_TOF_Init(); #ifdef STS_WS sts_weight_scale_init(); #endif diff --git a/LoRaWAN/App/app_lorawan.c b/LoRaWAN/App/app_lorawan.c index 1e40397..38f103c 100644 --- a/LoRaWAN/App/app_lorawan.c +++ b/LoRaWAN/App/app_lorawan.c @@ -25,7 +25,7 @@ #include "stm32_seq.h" /* USER CODE BEGIN Includes */ - +#include "app_tof.h" /* USER CODE END Includes */ /* External variables ---------------------------------------------------------*/ @@ -73,7 +73,7 @@ void MX_LoRaWAN_Init(void) /* USER CODE END MX_LoRaWAN_Init_2 */ LoRaWAN_Init(); /* USER CODE BEGIN MX_LoRaWAN_Init_3 */ - + //MX_TOF_Init(); /* USER CODE END MX_LoRaWAN_Init_3 */ } diff --git a/TOF/App/app_tof.c b/TOF/App/app_tof.c index f32d8f9..34bc787 100644 --- a/TOF/App/app_tof.c +++ b/TOF/App/app_tof.c @@ -136,6 +136,7 @@ static void MX_53L8A1_ThresholdDetection_Init(void) printf("VL53L8A1_RANGING_SENSOR_Init failed\n"); while (1); } + printf("\r\nVL53L8A1_RANGING_SENSOR_Init Success\r\n"); } static void MX_53L8A1_ThresholdDetection_Process(void) @@ -147,7 +148,7 @@ static void MX_53L8A1_ThresholdDetection_Process(void) VL53L8A1_RANGING_SENSOR_ReadID(VL53L8A1_DEV_CENTER, &Id); VL53L8A1_RANGING_SENSOR_GetCapabilities(VL53L8A1_DEV_CENTER, &Cap); - Profile.RangingProfile = RS_PROFILE_8x8_CONTINUOUS; + Profile.RangingProfile = RS_PROFILE_8x8_AUTONOMOUS; Profile.TimingBudget = TIMING_BUDGET; Profile.Frequency = RANGING_FREQUENCY; /* Ranging frequency Hz (shall be consistent with TimingBudget value) */ Profile.EnableAmbient = 0; /* Enable: 1, Disable: 0 */