diff --git a/Core/Inc/yunhorn_sts_prd_conf.h b/Core/Inc/yunhorn_sts_prd_conf.h index b0554cb..a567e36 100644 --- a/Core/Inc/yunhorn_sts_prd_conf.h +++ b/Core/Inc/yunhorn_sts_prd_conf.h @@ -32,7 +32,7 @@ /* * MCU CORE SELECTION */ -#define STS_USE_STM32WLE5 1U //STM32WLE5CCUX +//#define STS_USE_STM32WLE5 1U //STM32WLE5CCUX //#define USE_STM32WL55 1U //STM32WL55JC1X /* @@ -42,9 +42,10 @@ //#define USE_TOF_VL53L1X //#define STS_USE_TOF_VL53L0X 1U //#define YUNHORN_STS_R1_ENABLED -#define YUNHORN_STS_R3_ENABLED +//#define YUNHORN_STS_R3_ENABLED +#ifdef SOAP_LEVEL #define YUNHORN_STS_R4_ENABLED - +#endif // TOF VL53LX number //#define USE_MEMS_ADXL345 @@ -270,7 +271,6 @@ #define sts_sendhtbtport (YUNHORN_STS_R4_LORA_APP_HTBT_PORT) #endif - #ifdef YUNHORN_STS_R5_ENABLED #define sts_mtmcode1 0U #define sts_mtmcode2 16U @@ -284,7 +284,6 @@ #define sts_appctrl_reply_port (YUNHORN_STS_USER_APP_CTRL_REPLY_PORT) #ifdef STS_O5 -#define YUNHORN_STS_O5_ENABLED 1U #define sts_mtmcode1 0U #define sts_mtmcode2 5U #define sts_hardware_ver 1U diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index 2127eac..8ffbd83 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -639,29 +639,14 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) switch (GPIO_Pin) { case BUT1_Pin: -#if (defined(STS_USE_STM32WL55)||defined(STS_USE_STM32WLE5)) -#ifdef YUNHORN_STS_O5_ENABLED - UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP1), CFG_SEQ_Prio_0); - UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); -#else - uint8_t pinstate = HAL_GPIO_ReadPin(BUT1_GPIO_Port,BUT1_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 - { -#ifdef LED_ONBOARD - LED_ON; - HAL_Delay(20); - LED_OFF; +#ifdef SOAP_LEVEL + UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP6), CFG_SEQ_Prio_0); + UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); #endif + if (EventType == TX_ON_EVENT) + { + UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); } -#endif - -#endif break; case BUT2_Pin: #if defined(STS_USE_STM32WLE5) @@ -809,7 +794,7 @@ static void SendTxData(void) { uint8_t i = 0; //MX_TOF_Process(); -#if defined(YUNHORN_STS_O5_ENABLED) +#ifdef YUNHORN_STS_O5_ENABLED STS_O5_SENSOR_Read(&oo_data); #endif diff --git a/STM32CubeIDE/.cproject b/STM32CubeIDE/.cproject index d187b82..0eb74c2 100644 --- a/STM32CubeIDE/.cproject +++ b/STM32CubeIDE/.cproject @@ -39,8 +39,7 @@