diff --git a/Core/Src/yunhorn_sts_process.c b/Core/Src/yunhorn_sts_process.c index 9faf618..66c10f7 100644 --- a/Core/Src/yunhorn_sts_process.c +++ b/Core/Src/yunhorn_sts_process.c @@ -271,10 +271,11 @@ void STS_YunhornSTSEventP3_Process(void) void STS_YunhornSTSEventP4_Process(void) { STS_SENSOR_Power_ON(0); - HAL_Delay(100); + LED_ON; + HAL_Delay(50); APP_LOG(TS_OFF, VLEVEL_L, "\r\n P4 Testing Process\r\n"); STS_TOF_VL53L0X_Range_Process(); - + LED_OFF; STS_SENSOR_Power_OFF(0); } @@ -301,6 +302,13 @@ void STS_YunhornSTSEventP6_Process(void) { APP_LOG(TS_OFF, VLEVEL_L, "\r\n P6 Testing Process\r\n"); STS_SENSOR_Power_ON(0); + LED_ON; + HAL_Delay(50); + LED_OFF; + HAL_Delay(20); + LED_ON; + HAL_Delay(50); + LED_OFF; /* 1. Sensor Power On */ #if defined(SOAP_LEVEL_SENSOR) HAL_GPIO_WritePin(SOAP_SWITCH_GPIO_Port, SOAP_SWITCH_Pin, GPIO_PIN_SET); diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index 3fc30ce..b83642a 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -639,9 +639,19 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) APP_LOG(TS_OFF, VLEVEL_L, "##################################### BUTTON-1 DETECTED: %2d \r\n", pinstate); //if (EventType == TX_ON_EVENT) + if (pinstate == 1) { UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); + } else { + LED_ON; + HAL_Delay(50); + LED_OFF; + HAL_Delay(20); + LED_ON; + HAL_Delay(50); + LED_OFF; } + #endif break; case BUT2_Pin: @@ -786,12 +796,18 @@ static void SendTxData(void) uint8_t i = 0; //MX_TOF_Process(); LED_ON; +#if defined(SOAP_LEVEL_SENSOR) STS_YunhornSTSEventP6_Process(); HAL_Delay(200); + STS_YunhornSTSEventP4_Process(); LED_OFF; + HAL_Delay(200); + LED_ON; +#endif //UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP6), CFG_SEQ_Prio_0); - //UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP4), CFG_SEQ_Prio_0); + UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP4), CFG_SEQ_Prio_0); + LED_OFF; STS_R0_SENSOR_Read(&r0_data); r0_data.battery_mV = batteryLevelmV; r0_data.battery_Pct = (uint8_t)(99*batteryLevel/254); diff --git a/STM32CubeIDE/.cproject b/STM32CubeIDE/.cproject index 364820f..81f4f20 100644 --- a/STM32CubeIDE/.cproject +++ b/STM32CubeIDE/.cproject @@ -68,6 +68,7 @@ + @@ -78,7 +79,7 @@