good at sleep 27uA

This commit is contained in:
Yunhorn 2024-03-13 19:01:26 +08:00
parent 7bb8e54e68
commit b0793ee97f
4 changed files with 12 additions and 152 deletions

View File

@ -6,8 +6,8 @@
******************************************************************************* *******************************************************************************
* @attention * @attention
* *
* Copyright (c) 2022 Yunhorn Technology Limited. * Copyright (c) 2024 Yunhorn Technology Limited.
* Copyright (c) 2022 Shenzhen Yunhorn Technology Co., Ltd. * Copyright (c) 2024 Shenzhen Yunhorn Technology Co., Ltd.
* All rights reserved. * All rights reserved.
* *
* This software is licensed under terms that can be found in the LICENSE file * This software is licensed under terms that can be found in the LICENSE file
@ -42,6 +42,7 @@
//#define USE_TOF_VL53L1X //#define USE_TOF_VL53L1X
#ifdef STS_R1D #ifdef STS_R1D
#define YUNHORN_STS_R0_ENABLED 1U
#define YUNHORN_STS_R1_ENABLED 1U #define YUNHORN_STS_R1_ENABLED 1U
#define STS_USE_TOF_VL53L0X 1U #define STS_USE_TOF_VL53L0X 1U
#endif #endif
@ -50,129 +51,6 @@
* @brief This is the list of Yunhorn STS products to be used in ALL product config * @brief This is the list of Yunhorn STS products to be used in ALL product config
*/ */
/* YUNHORN SMARTOILETS OCCUPANCY PRODUCTS */
/*#define YUNHORN_STS_O1_ENABLED */
/*#define YUNHORN_STS_O2_ENABLED */
/*#define YUNHORN_STS_O3_ENABLED */
/*#define YUNHORN_STS_O4_ENABLED */
/*#define YUNHORN_STS_O5_ENABLED */
/*#define YUNHORN_STS_O6_ENABLED */
/*#define YUNHORN_STS_O7_ENABLED */
/*#define YUNHORN_STS_O8_ENABLED */
/*#define YUNHORN_STS_O9_ENABLED */
/*#define YUNHORN_STS_O10_ENABLED */
/*#define YUNHORN_STS_O6_ENABLED */
/* YUNHORN SMARTOILETS ENVIRONMENT PRODUCTS */
/*#define YUNHORN_STS_E1_ENABLED */
/*#define YUNHORN_STS_E2_ENABLED */
/*#define YUNHORN_STS_E3_ENABLED */
/*#define YUNHORN_STS_E4_ENABLED */
/*#define YUNHORN_STS_E5_ENABLED */
/*#define YUNHORN_STS_E6_ENABLED */
/* YUNHORN SMARTOILETS PEOPLE COUNTING PRODUCTS */
/*#define YUNHORN_STS_P1_ENABLED */
/*#define YUNHORN_STS_P2_ENABLED */
/*#define YUNHORN_STS_P3_ENABLED */
/*#define YUNHORN_STS_P4_ENABLED */
/*#define YUNHORN_STS_P5_ENABLED */
/*#define YUNHORN_STS_P6_ENABLED */
/* YUNHORN SMARTOILETS CLEANSING RESOUCES LEVEL PRODUCTS */
//#define YUNHORN_STS_R0_ENABLED
//#define YUNHORN_STS_R0_ENABLED
//#define YUNHORN_STS_R2_ENABLED
//#define YUNHORN_STS_R3_ENABLED
//#define YUNHORN_STS_R4_ENABLED
/* YUNHORN SMARTOILETS MECHNICAL REACTURAL PRODUCTS */
/*#define YUNHORN_STS_M1_ENABLED */
/*#define YUNHORN_STS_M2_ENABLED */
/*#define YUNHORN_STS_M3_ENABLED */
/*#define YUNHORN_STS_M4_ENABLED */
/*#define YUNHORN_STS_M5_ENABLED */
/*#define YUNHORN_STS_M6_ENABLED */
/*#define YUNHORN_STS_M7_ENABLED */
/*#define YUNHORN_STS_M8_ENABLED */
/*#define YUNHORN_STS_M9_ENABLED */
/*#define YUNHORN_STS_M10_ENABLED */
/* YUNHORN SMARTOILETS DIPLAY AND SMART PANEL PRODUCTS */
/*#define YUNHORN_STS_D1_ENABLED */
/*#define YUNHORN_STS_D2_ENABLED */
/*#define YUNHORN_STS_D3_ENABLED */
/*#define YUNHORN_STS_D4_ENABLED */
/*#define YUNHORN_STS_D5_ENABLED */
/*#define YUNHORN_STS_D6_ENABLED */
/*#define YUNHORN_STS_D7_ENABLED */
/*#define YUNHORN_STS_D8_ENABLED */
/** YUNHORN SMARTOILETS DIGITAL SIGNAGE PRODUCTS **/
/*#define YUNHORN_STS_F1_ENABLED */
/*#define YUNHORN_STS_F2_ENABLED */
/*#define YUNHORN_STS_F3_ENABLED */
/*#define YUNHORN_STS_F4_ENABLED */
/*#define YUNHORN_STS_F5_ENABLED */
/*#define YUNHORN_STS_F6_ENABLED */
/*#define YUNHORN_STS_F7_ENABLED */
/*#define YUNHORN_STS_F8_ENABLED */
/*#define YUNHORN_STS_F9_ENABLED */
/*#define YUNHORN_STS_F10_ENABLED */
/** YUNHORN SMARTOILETS CONNECTIVITY AND GATEWAY PRODUCTS **/
/*#define YUNHORN_STS_N1_ENABLED */
/*#define YUNHORN_STS_N2_ENABLED */
/*#define YUNHORN_STS_N3_ENABLED */
/*#define YUNHORN_STS_N4_ENABLED */
/*#define YUNHORN_STS_N5_ENABLED */
/*#define YUNHORN_STS_N6_ENABLED */
/*#define YUNHORN_STS_N7_ENABLED */
/*#define YUNHORN_STS_N8_ENABLED */
/** Includes ---------------------------------------------------------
* @brief YUNHORN SMARTOILETS SENSOR
* LORA-WAN MESSAGE UPLINK DATA PORTS AND HEARTBEAT PORTS DEFINATION
*/
//#define YUNHORN_STS_O1_LORA_APP_DATA_PORT 4U
//#define YUNHORN_STS_O1_LORA_APP_HTBT_PORT 5U
//#define YUNHORN_STS_O2_LORA_APP_DATA_PORT 4U
//#define YUNHORN_STS_O2_LORA_APP_HTBT_PORT 5U
//#define YUNHORN_STS_O3_LORA_APP_DATA_PORT 4U
//#define YUNHORN_STS_O3_LORA_APP_HTBT_PORT 5U
//#define YUNHORN_STS_O4_LORA_APP_DATA_PORT 56U
//#define YUNHORN_STS_O4_LORA_APP_HTBT_PORT 57U
#ifdef STS_O5
#define YUNHORN_STS_O5_LORA_APP_DATA_PORT 4U
#define YUNHORN_STS_O5_LORA_APP_HTBT_PORT 5U
#endif
//#define YUNHORN_STS_O6_LORA_APP_DATA_PORT 17U
//#define YUNHORN_STS_O6_LORA_APP_HTBT_PORT 18U
//#define YUNHORN_STS_O6_USER_APP_CTRL_PORT 2U
//#define YUNHORN_STS_O6_USER_APP_CTRL_REPLY_PORT 1U
//#define YUNHORN_STS_E1_LORA_APP_DATA_PORT 102U
//#define YUNHORN_STS_E1_LORA_APP_HTBT_PORT 103U
//#define YUNHORN_STS_E2_LORA_APP_DATA_PORT 101U
//#define YUNHORN_STS_E2_LORA_APP_HTBT_PORT 108U
//#define YUNHORN_STS_E3_LORA_APP_DATA_PORT 00U
//#define YUNHORN_STS_E3_LORA_APP_HTBT_PORT 00U
//#define YUNHORN_STS_E4_LORA_APP_DATA_PORT 70U
//#define YUNHORN_STS_E4_LORA_APP_HTBT_PORT 71U
#define YUNHORN_STS_USER_APP_CTRL_PORT 2U #define YUNHORN_STS_USER_APP_CTRL_PORT 2U
#define YUNHORN_STS_USER_APP_CTRL_REPLY_PORT 1U #define YUNHORN_STS_USER_APP_CTRL_REPLY_PORT 1U
@ -264,17 +142,6 @@
#define sts_appctrlport (YUNHORN_STS_USER_APP_CTRL_PORT) #define sts_appctrlport (YUNHORN_STS_USER_APP_CTRL_PORT)
#define sts_appctrl_reply_port (YUNHORN_STS_USER_APP_CTRL_REPLY_PORT) #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
#define sts_version 1U
#define sts_senddataport (YUNHORN_STS_O5_LORA_APP_DATA_PORT)
#define sts_sendhtbtport (YUNHORN_STS_O5_LORA_APP_HTBT_PORT)
#endif
//#define NVM_CFG_PARAMETER_SIZE (STS_R0_NVM_CFG_SIZE) //#define NVM_CFG_PARAMETER_SIZE (STS_R0_NVM_CFG_SIZE)

View File

@ -59,7 +59,7 @@ void MX_GPIO_Init(void)
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
//__HAL_RCC_GPIOA_CLK_DISABLE(); //__HAL_RCC_GPIOA_CLK_DISABLE();
//__HAL_RCC_GPIOB_CLK_DISABLE(); //__HAL_RCC_GPIOB_CLK_DISABLE();
//__HAL_RCC_GPIOC_CLK_DISABLE(); __HAL_RCC_GPIOC_CLK_DISABLE();
/*Configure GPIO pin Output Level */ /*Configure GPIO pin Output Level */
#if defined(STM32WL55xx) #if defined(STM32WL55xx)

View File

@ -633,28 +633,18 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
switch (GPIO_Pin) switch (GPIO_Pin)
{ {
case BUT1_Pin: case BUT1_Pin:
if (EventType == TX_ON_EVENT)
{
#ifdef YUNHORN_STS_O5_ENABLED #ifdef YUNHORN_STS_O5_ENABLED
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP1), CFG_SEQ_Prio_0); UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP1), CFG_SEQ_Prio_0);
#endif
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), 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_H, "## 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 #ifdef LED_ONBOARD
LED_ON; LED_ON;
HAL_Delay(20); HAL_Delay(20);
LED_OFF; LED_OFF;
#endif #endif
//}
#endif
break; break;
case BUT2_Pin: case BUT2_Pin:

View File

@ -225,6 +225,9 @@
</scannerConfigBuildInfo> </scannerConfigBuildInfo>
</storageModule> </storageModule>
<storageModule moduleId="refreshScope" versionNumber="2"> <storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Multiple configurations">
<resource resourceType="PROJECT" workspacePath="/STS_RR_R125"/>
</configuration>
<configuration configurationName="Debug"> <configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/LoRaWAN_End_Node"/> <resource resourceType="PROJECT" workspacePath="/LoRaWAN_End_Node"/>
</configuration> </configuration>