From 0a12838556be84554f97964d43fb0f9239a7923c Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Fri, 23 Feb 2024 18:13:17 +0800 Subject: [PATCH] revised bat level with ER34615 --- Core/Inc/sys_conf.h | 6 +++--- Core/Inc/yunhorn_sts_prd_conf.h | 8 ++++---- Core/Src/adc_if.c | 3 ++- LoRaWAN/App/lora_app.c | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Core/Inc/sys_conf.h b/Core/Inc/sys_conf.h index cf0598b..98b43c2 100644 --- a/Core/Inc/sys_conf.h +++ b/Core/Inc/sys_conf.h @@ -47,12 +47,12 @@ extern "C" { /** * @brief Verbose level for all trace logs */ -#define VERBOSE_LEVEL VLEVEL_H +#define VERBOSE_LEVEL VLEVEL_OFF /** * @brief Enable trace logs */ -#define APP_LOG_ENABLED 1 +#define APP_LOG_ENABLED 0 /** * @brief Activate monitoring (probes) of some internal RF signals for debug purpose @@ -75,7 +75,7 @@ extern "C" { * @brief Enable/Disable MCU Debugger pins (dbg serial wires) * @note by HW serial wires are ON by default, need to put them OFF to save power */ -#define DEBUGGER_ENABLED 1 +#define DEBUGGER_ENABLED 0 /** * @brief Disable Low Power mode diff --git a/Core/Inc/yunhorn_sts_prd_conf.h b/Core/Inc/yunhorn_sts_prd_conf.h index 98bc7c0..c39ea00 100644 --- a/Core/Inc/yunhorn_sts_prd_conf.h +++ b/Core/Inc/yunhorn_sts_prd_conf.h @@ -58,9 +58,9 @@ */ #ifdef YUNHORN_STS_M7_ENABLED -#define MajorVer 23U -#define MinorVer 12U -#define SubMinorVer 20U +#define MajorVer 24U +#define MinorVer 02U +#define SubMinorVer 23U #define FirmwareVersion 3U /* #define YUNHORN_STS_M7_NVM_CFG_SIZE 3U @@ -133,7 +133,7 @@ #define BAT_ER14505_2P_4800MAH ((uint32_t) 3600) #define BAT_STS_BOARD_3V3 ((uint32_t) 3300) -#define VDD_BAT BAT_CR2450 +#define VDD_BAT BAT_ER34615_19000AH /* STM32WL55JC READ/WRITE FLASH ADDRESS AND SIZE * SECTION START ADDRESS SIZE diff --git a/Core/Src/adc_if.c b/Core/Src/adc_if.c index ba66547..df6c636 100644 --- a/Core/Src/adc_if.c +++ b/Core/Src/adc_if.c @@ -144,7 +144,8 @@ uint16_t SYS_GetBatteryLevel(void) uint16_t batteryLevelmV = 0; uint32_t measuredLevel = 0; - measuredLevel = ADC_ReadChannels(ADC_CHANNEL_VREFINT); + //measuredLevel = ADC_ReadChannels(ADC_CHANNEL_VREFINT); + measuredLevel = ADC_ReadChannels(ADC_CHANNEL_VBAT); if (measuredLevel == 0) { diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index fa71bc4..fb68277 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -54,7 +54,7 @@ volatile uint8_t sts_ac_code[YUNHORN_STS_AC_CODE_SIZE]={0x0}; volatile uint8_t heart_beat_timer=0, sts_lorawan_joined=0; volatile sts_cfg_nvm_t sts_cfg_nvm={sts_mtmcode1,sts_mtmcode2, sts_version, sts_hardware_ver, 0x3C,'M', 0x60,'M', 0x04,0x00,0x00,0x20, -{0x0,0x0,0x0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}, +{0x08,0x06,0x04,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}, 0x01,0x03,0x00,0x02, {0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF} };