1、修改进入POWERDOWN模式前,重新配IO口,防止漏电流,进一步降低待机功耗。

This commit is contained in:
DESKTOP-BUI7OAO\15586 2025-06-27 15:49:56 +08:00
parent 1477556ae7
commit f5696f9e7c
22 changed files with 12910 additions and 12648 deletions

View File

@ -51,6 +51,7 @@ void IIC_IO_Config(void)
i2c_Init(I2C0,U32BIT(I2C0_SCLK),U32BIT(I2C0_SDA)); //lsm6d IIC IO³õʼ»¯
i2c_Init(I2C1,U32BIT(I2C1_SCLK),U32BIT(I2C1_SDA)); //lis2d IIC IO³õʼ»¯
}
/*************************************************************************************************
* Function Name:
* Description :

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@ I (D:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cms
I (D:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_compiler.h)(0x5E8306C2)
I (D:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_armcc.h)(0x5E8ED122)
I (D:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\ARM\ARMCM0\Include\system_ARMCM0.h)(0x5E8ED12A)
I (..\..\User\config.h)(0x68479A42)
I (..\..\User\config.h)(0x685E4314)
I (..\..\Lib\lib.h)(0x684673D7)
I (..\..\Include\uart.h)(0x684673D7)
I (D:\Keil_v5\ARM\ARMCC\include\stdarg.h)(0x5EC775FC)
@ -66,7 +66,7 @@ I (D:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cms
I (D:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_armcc.h)(0x5E8ED122)
I (D:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\ARM\ARMCM0\Include\system_ARMCM0.h)(0x5E8ED12A)
I (..\..\Include\debug.h)(0x684673D7)
I (..\..\User\config.h)(0x68479A42)
I (..\..\User\config.h)(0x685E4314)
I (..\..\Lib\lib.h)(0x684673D7)
I (..\..\Include\gpio.h)(0x684673D7)
F (..\..\Driver\wdt.c)(0x684673D7)(-c --cpu Cortex-M0 -D__MICROLIB -g -O0 --apcs=interwork -I ..\..\Include -I ..\..\Driver -I ..\..\Rtt -I ..\..\Lib -I ..\..\User -I ..\..\Hardware -I ..\..\Taskrun -I ..\..\App -I.\RTE\_Syd8811_Peripheral -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\ARM\ARMCM0\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\Include -D__UVISION_VERSION="531" -D_RTE_ -DARMCM0 -D_RTE_ -DSYD8811_FRB8345 -D_OTA_ -o .\output\wdt.o --omf_browse .\output\wdt.crf --depend .\output\wdt.d)
@ -82,7 +82,7 @@ F (..\..\Driver\timer_handler.c)(0x68479A42)(-c --cpu Cortex-M0 -D__MICROLIB -g
I (..\..\Lib\calender.h)(0x684673D7)
I (D:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5EC775FC)
I (..\..\Lib\softtimer.h)(0x684673D7)
I (..\..\User\config.h)(0x68479A42)
I (..\..\User\config.h)(0x685E4314)
I (..\..\Lib\lib.h)(0x684673D7)
I (..\..\Include\ARMCM0.h)(0x684673D7)
I (D:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\core_cm0.h)(0x5E8ED122)
@ -95,7 +95,7 @@ I (..\..\Rtt\SEGGER_RTT.h)(0x684673D7)
I (..\..\Rtt\SEGGER_RTT_Conf.h)(0x684673D7)
F (..\..\Driver\rtc_handler.c)(0x684673D7)(-c --cpu Cortex-M0 -D__MICROLIB -g -O0 --apcs=interwork -I ..\..\Include -I ..\..\Driver -I ..\..\Rtt -I ..\..\Lib -I ..\..\User -I ..\..\Hardware -I ..\..\Taskrun -I ..\..\App -I.\RTE\_Syd8811_Peripheral -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\ARM\ARMCM0\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\Include -D__UVISION_VERSION="531" -D_RTE_ -DARMCM0 -D_RTE_ -DSYD8811_FRB8345 -D_OTA_ -o .\output\rtc_handler.o --omf_browse .\output\rtc_handler.crf --depend .\output\rtc_handler.d)
I (..\..\Lib\softtimer.h)(0x684673D7)
I (..\..\User\config.h)(0x68479A42)
I (..\..\User\config.h)(0x685E4314)
I (..\..\Lib\lib.h)(0x684673D7)
I (..\..\Include\ARMCM0.h)(0x684673D7)
I (D:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\core_cm0.h)(0x5E8ED122)
@ -113,7 +113,7 @@ I (D:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cms
I (D:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_compiler.h)(0x5E8306C2)
I (D:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_armcc.h)(0x5E8ED122)
I (D:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\ARM\ARMCM0\Include\system_ARMCM0.h)(0x5E8ED12A)
I (..\..\User\config.h)(0x68479A42)
I (..\..\User\config.h)(0x685E4314)
I (..\..\Lib\lib.h)(0x684673D7)
I (..\..\Include\debug.h)(0x684673D7)
I (D:\Keil_v5\ARM\ARMCC\include\string.h)(0x5EC77604)
@ -122,7 +122,7 @@ I (..\..\Lib\softtimer.h)(0x684673D7)
I (..\..\Rtt\DebugLog.h)(0x684673D7)
I (..\..\Rtt\SEGGER_RTT.h)(0x684673D7)
I (..\..\Rtt\SEGGER_RTT_Conf.h)(0x684673D7)
F (..\..\App\app_gpio.c)(0x68528FEB)(-c --cpu Cortex-M0 -D__MICROLIB -g -O0 --apcs=interwork -I ..\..\Include -I ..\..\Driver -I ..\..\Rtt -I ..\..\Lib -I ..\..\User -I ..\..\Hardware -I ..\..\Taskrun -I ..\..\App -I.\RTE\_Syd8811_Peripheral -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\ARM\ARMCM0\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\Include -D__UVISION_VERSION="531" -D_RTE_ -DARMCM0 -D_RTE_ -DSYD8811_FRB8345 -D_OTA_ -o .\output\app_gpio.o --omf_browse .\output\app_gpio.crf --depend .\output\app_gpio.d)
F (..\..\App\app_gpio.c)(0x685E176E)(-c --cpu Cortex-M0 -D__MICROLIB -g -O0 --apcs=interwork -I ..\..\Include -I ..\..\Driver -I ..\..\Rtt -I ..\..\Lib -I ..\..\User -I ..\..\Hardware -I ..\..\Taskrun -I ..\..\App -I.\RTE\_Syd8811_Peripheral -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\ARM\ARMCM0\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\Include -D__UVISION_VERSION="531" -D_RTE_ -DARMCM0 -D_RTE_ -DSYD8811_FRB8345 -D_OTA_ -o .\output\app_gpio.o --omf_browse .\output\app_gpio.crf --depend .\output\app_gpio.d)
I (..\..\App\app_gpio.h)(0x684673D7)
I (..\..\Include\gpio.h)(0x684673D7)
I (..\..\Include\ARMCM0.h)(0x684673D7)
@ -176,7 +176,7 @@ I (..\..\Lib\lib.h)(0x684673D7)
I (..\..\Include\i2c.h)(0x684673D7)
I (..\..\User\mcu_bsp.h)(0x685DEFCF)
I (..\..\Rtt\DebugLog.h)(0x684673D7)
I (..\..\User\config.h)(0x68479A42)
I (..\..\User\config.h)(0x685E4314)
I (..\..\Rtt\SEGGER_RTT.h)(0x684673D7)
I (..\..\Rtt\SEGGER_RTT_Conf.h)(0x684673D7)
F (..\..\Hardware\lsm6d.c)(0x68550F60)(-c --cpu Cortex-M0 -D__MICROLIB -g -O0 --apcs=interwork -I ..\..\Include -I ..\..\Driver -I ..\..\Rtt -I ..\..\Lib -I ..\..\User -I ..\..\Hardware -I ..\..\Taskrun -I ..\..\App -I.\RTE\_Syd8811_Peripheral -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\ARM\ARMCM0\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\Include -D__UVISION_VERSION="531" -D_RTE_ -DARMCM0 -D_RTE_ -DSYD8811_FRB8345 -D_OTA_ -o .\output\lsm6d.o --omf_browse .\output\lsm6d.crf --depend .\output\lsm6d.d)
@ -197,7 +197,7 @@ I (..\..\Include\i2c.h)(0x684673D7)
I (..\..\Include\delay.h)(0x684673D7)
I (..\..\User\mcu_bsp.h)(0x685DEFCF)
I (..\..\Rtt\DebugLog.h)(0x684673D7)
I (..\..\User\config.h)(0x68479A42)
I (..\..\User\config.h)(0x685E4314)
I (..\..\Rtt\SEGGER_RTT.h)(0x684673D7)
I (..\..\Rtt\SEGGER_RTT_Conf.h)(0x684673D7)
F (..\..\Hardware\lis2dh12_reg.c)(0x684673D7)(-c --cpu Cortex-M0 -D__MICROLIB -g -O0 --apcs=interwork -I ..\..\Include -I ..\..\Driver -I ..\..\Rtt -I ..\..\Lib -I ..\..\User -I ..\..\Hardware -I ..\..\Taskrun -I ..\..\App -I.\RTE\_Syd8811_Peripheral -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\ARM\ARMCM0\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\Include -D__UVISION_VERSION="531" -D_RTE_ -DARMCM0 -D_RTE_ -DSYD8811_FRB8345 -D_OTA_ -o .\output\lis2dh12_reg.o --omf_browse .\output\lis2dh12_reg.crf --depend .\output\lis2dh12_reg.d)
@ -228,7 +228,7 @@ F (..\..\Hardware\common.c)(0x684673D7)(-c --cpu Cortex-M0 -D__MICROLIB -g -O0 -
I (..\..\Hardware\common.h)(0x684673D7)
F (..\..\Lib\syd8811_ble_lib.lib)(0x684673D7)()
F (..\..\Lib\Syd8811_softtimer_lib20240514_225042.lib)(0x684673D7)()
F (..\main.c)(0x685DFF84)(-c --cpu Cortex-M0 -D__MICROLIB -g -O0 --apcs=interwork -I ..\..\Include -I ..\..\Driver -I ..\..\Rtt -I ..\..\Lib -I ..\..\User -I ..\..\Hardware -I ..\..\Taskrun -I ..\..\App -I.\RTE\_Syd8811_Peripheral -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\ARM\ARMCM0\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\Include -D__UVISION_VERSION="531" -D_RTE_ -DARMCM0 -D_RTE_ -DSYD8811_FRB8345 -D_OTA_ -o .\output\main.o --omf_browse .\output\main.crf --depend .\output\main.d)
F (..\main.c)(0x685E4A8F)(-c --cpu Cortex-M0 -D__MICROLIB -g -O0 --apcs=interwork -I ..\..\Include -I ..\..\Driver -I ..\..\Rtt -I ..\..\Lib -I ..\..\User -I ..\..\Hardware -I ..\..\Taskrun -I ..\..\App -I.\RTE\_Syd8811_Peripheral -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\ARM\ARMCM0\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\Include -D__UVISION_VERSION="531" -D_RTE_ -DARMCM0 -D_RTE_ -DSYD8811_FRB8345 -D_OTA_ -o .\output\main.o --omf_browse .\output\main.crf --depend .\output\main.d)
I (..\mcu_bsp.h)(0x685DEFCF)
I (..\..\Include\ARMCM0.h)(0x684673D7)
I (D:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\core_cm0.h)(0x5E8ED122)
@ -246,7 +246,7 @@ I (D:\Keil_v5\ARM\ARMCC\include\math.h)(0x5EC77604)
I (..\..\Hardware\lis2dh.h)(0x684673D7)
I (..\..\Hardware\lis2dh12_reg.h)(0x684673D7)
I (..\..\Include\ota.h)(0x684673D7)
I (..\..\User\config.h)(0x68479A42)
I (..\..\User\config.h)(0x685E4314)
I (..\..\Include\gpadc.h)(0x684673D7)
I (..\..\Include\delay.h)(0x684673D7)
I (..\..\Hardware\cjson.h)(0x684673D7)
@ -296,12 +296,12 @@ I (..\..\Hardware\lsm6dso_reg.h)(0x684673D7)
I (D:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x5EC775FC)
I (D:\Keil_v5\ARM\ARMCC\include\math.h)(0x5EC77604)
I (..\..\Rtt\DebugLog.h)(0x684673D7)
I (..\..\User\config.h)(0x68479A42)
I (..\..\User\config.h)(0x685E4314)
I (..\..\Rtt\SEGGER_RTT.h)(0x684673D7)
I (..\..\Rtt\SEGGER_RTT_Conf.h)(0x684673D7)
F (..\..\Rtt\SEGGER_RTT.c)(0x684673D7)(-c --cpu Cortex-M0 -D__MICROLIB -g -O0 --apcs=interwork -I ..\..\Include -I ..\..\Driver -I ..\..\Rtt -I ..\..\Lib -I ..\..\User -I ..\..\Hardware -I ..\..\Taskrun -I ..\..\App -I.\RTE\_Syd8811_Peripheral -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\ARM\ARMCM0\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\Include -D__UVISION_VERSION="531" -D_RTE_ -DARMCM0 -D_RTE_ -DSYD8811_FRB8345 -D_OTA_ -o .\output\segger_rtt.o --omf_browse .\output\segger_rtt.crf --depend .\output\segger_rtt.d)
I (..\..\Rtt\DebugLog.h)(0x684673D7)
I (..\..\User\config.h)(0x68479A42)
I (..\..\User\config.h)(0x685E4314)
I (..\..\Lib\lib.h)(0x684673D7)
I (..\..\Include\ARMCM0.h)(0x684673D7)
I (D:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\core_cm0.h)(0x5E8ED122)
@ -315,7 +315,7 @@ I (..\..\Rtt\SEGGER_RTT_Conf.h)(0x684673D7)
I (D:\Keil_v5\ARM\ARMCC\include\string.h)(0x5EC77604)
F (..\..\Rtt\SEGGER_RTT_printf.c)(0x684673D7)(-c --cpu Cortex-M0 -D__MICROLIB -g -O0 --apcs=interwork -I ..\..\Include -I ..\..\Driver -I ..\..\Rtt -I ..\..\Lib -I ..\..\User -I ..\..\Hardware -I ..\..\Taskrun -I ..\..\App -I.\RTE\_Syd8811_Peripheral -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\ARM\ARMCM0\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\Include -D__UVISION_VERSION="531" -D_RTE_ -DARMCM0 -D_RTE_ -DSYD8811_FRB8345 -D_OTA_ -o .\output\segger_rtt_printf.o --omf_browse .\output\segger_rtt_printf.crf --depend .\output\segger_rtt_printf.d)
I (..\..\Rtt\DebugLog.h)(0x684673D7)
I (..\..\User\config.h)(0x68479A42)
I (..\..\User\config.h)(0x685E4314)
I (..\..\Lib\lib.h)(0x684673D7)
I (..\..\Include\ARMCM0.h)(0x684673D7)
I (D:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\core_cm0.h)(0x5E8ED122)
@ -331,7 +331,7 @@ I (D:\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x5EC775FC)
I (D:\Keil_v5\ARM\ARMCC\include\stdarg.h)(0x5EC775FC)
F (..\..\Rtt\SEGGER_RTT_Syscalls_KEIL.c)(0x684673D7)(-c --cpu Cortex-M0 -D__MICROLIB -g -O0 --apcs=interwork -I ..\..\Include -I ..\..\Driver -I ..\..\Rtt -I ..\..\Lib -I ..\..\User -I ..\..\Hardware -I ..\..\Taskrun -I ..\..\App -I.\RTE\_Syd8811_Peripheral -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\ARM\ARMCM0\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\Include -D__UVISION_VERSION="531" -D_RTE_ -DARMCM0 -D_RTE_ -DSYD8811_FRB8345 -D_OTA_ -o .\output\segger_rtt_syscalls_keil.o --omf_browse .\output\segger_rtt_syscalls_keil.crf --depend .\output\segger_rtt_syscalls_keil.d)
I (..\..\Rtt\DebugLog.h)(0x684673D7)
I (..\..\User\config.h)(0x68479A42)
I (..\..\User\config.h)(0x685E4314)
I (..\..\Lib\lib.h)(0x684673D7)
I (..\..\Include\ARMCM0.h)(0x684673D7)
I (D:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\core_cm0.h)(0x5E8ED122)
@ -348,7 +348,7 @@ I (D:\Keil_v5\ARM\ARMCC\include\string.h)(0x5EC77604)
I (D:\Keil_v5\ARM\ARMCC\include\rt_sys.h)(0x5EC775FC)
I (D:\Keil_v5\ARM\ARMCC\include\rt_misc.h)(0x5EC775F2)
I (D:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x5EC775FC)
F (..\..\doc.txt)(0x685DFFDE)()
F (..\..\doc.txt)(0x685E4C9B)()
F (RTE\Device\ARMCM0\startup_ARMCM0.s)(0x684673D7)(--cpu Cortex-M0 -g --apcs=interwork --pd "__MICROLIB SETA 1" -I.\RTE\_Syd8811_Peripheral -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\ARM\ARMCM0\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\Include --pd "__UVISION_VERSION SETA 531" --pd "_RTE_ SETA 1" --pd "ARMCM0 SETA 1" --pd "_RTE_ SETA 1" --list .\output\startup_armcm0.lst --xref -o .\output\startup_armcm0.o --depend .\output\startup_armcm0.d)
F (RTE\Device\ARMCM0\system_ARMCM0.c)(0x684673D7)(-c --cpu Cortex-M0 -D__MICROLIB -g -O0 --apcs=interwork -I ..\..\Include -I ..\..\Driver -I ..\..\Rtt -I ..\..\Lib -I ..\..\User -I ..\..\Hardware -I ..\..\Taskrun -I ..\..\App -I.\RTE\_Syd8811_Peripheral -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\ARM\ARMCM0\Include -ID:\Users\15586\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\Device\Include -D__UVISION_VERSION="531" -D_RTE_ -DARMCM0 -D_RTE_ -DSYD8811_FRB8345 -D_OTA_ -o .\output\system_armcm0.o --omf_browse .\output\system_armcm0.crf --depend .\output\system_armcm0.d)
I (..\..\Include\ARMCM0.h)(0x684673D7)

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -456,7 +456,7 @@
<Group>
<GroupName>App</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@ -592,7 +592,7 @@
<Group>
<GroupName>BLE</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>

View File

@ -8,6 +8,8 @@
#define USER_32K_CLOCK_RCOSCxx //使用芯片内部的32K的RC晶振
#define BATTERY_low_PROTECT
#define PDULENTH 20
#define Device_Name 'C','a','d','e','n','c','e','-','0','0','0','0'

View File

@ -47,6 +47,8 @@ uint8_t update_latency_mode=0;
uint8_t start_tx = 0;
uint8_t syd_nosleep_control=0;
int batteryPercentage =0; /**< 剩余电量百分比*/
uint8_t battery20s_flag = 0;
uint8_t Battery_low = 0;
/* adv data array*/
uint8_t ADV_DATA[] = {
0x02, /**< length*/
@ -107,6 +109,7 @@ uint8_t BLE_NotifyBatteryLevel();
uint8_t get_battery_value();
static void rf_stop(void);
static void PowerDown(void);
static void Low_Power_IOConfig(void);
void gpio_init(void);
void Charge_State_Judge(void);
void LED_State_Indicator(void);
@ -176,9 +179,7 @@ int main()
ReadFlashData(FLASH_INTERNAL_DATA_ADDR, sizeof(PAS.transpModes), (unsigned char*)&PAS.transpModes);
__enable_irq();
get_battery_value(); //上电或者POWNDOWN唤醒时计算一次电量
while(1)
{
ble_sched_execute(); /*协议栈任务轮训*/
@ -321,11 +322,22 @@ static void PowerDown(void)
LED_ON();
delay_ms(300);
LED_OFF();
if(Battery_low == 1)
{
LED_ON();delay_ms(300);LED_OFF();
LED_ON();delay_ms(300);LED_OFF();
LED_ON();delay_ms(300);LED_OFF();
LED_ON();delay_ms(300);LED_OFF();
LED_ON();delay_ms(300);LED_OFF();
}
Lsm6dso_Disable();
PEN_DISABLE();
CEN_DISABLE(); // 母线电压采样MOS关闭
Low_Power_IOConfig();
pw_cfg.wakeup_type = POWERDOWN_WAKEUP;
pw_cfg.wdt_wakeup_en = (bool)false;
@ -360,6 +372,51 @@ static void PowerDown(void)
__enable_irq();
}
/*********************************************************************
* Function : PowerDown
* Param in : none
* Param out: none
* Return : none
* Describe : PowerDown
*/
static void Low_Power_IOConfig(void)
{
PIN_Set_GPIO(U32BIT(SA0_PIN),PIN_SEL_GPIO);
GPIO_Set_Input(U32BIT(SA0_PIN),0); //设置为输入 不取反
PIN_Pullup_Disable(T_QFN_48, U32BIT(SA0_PIN)); //关闭上拉输入
GPIO_Input_Disable(U32BIT(SA0_PIN));
PIN_Set_GPIO(U32BIT(I2C0_SCLK),PIN_SEL_GPIO);
GPIO_Set_Input(U32BIT(I2C0_SCLK),0); //设置为输入 不取反
PIN_Pullup_Disable(T_QFN_48, U32BIT(I2C0_SCLK)); //关闭上拉输入
GPIO_Input_Disable(U32BIT(I2C0_SCLK));
PIN_Set_GPIO(U32BIT(I2C0_SDA),PIN_SEL_GPIO);
GPIO_Set_Input(U32BIT(I2C0_SDA),0); //设置为输入 不取反
PIN_Pullup_Disable(T_QFN_48, U32BIT(I2C0_SDA)); //关闭上拉输入
GPIO_Input_Disable(U32BIT(I2C0_SDA));
PIN_Set_GPIO(U32BIT(I2C1_SCLK),PIN_SEL_GPIO);
GPIO_Set_Input(U32BIT(I2C1_SCLK),0); //设置为输入 不取反
PIN_Pullup_Disable(T_QFN_48, U32BIT(I2C1_SCLK)); //关闭上拉输入
GPIO_Input_Disable(U32BIT(I2C1_SCLK));
PIN_Set_GPIO(U32BIT(I2C1_SDA),PIN_SEL_GPIO);
GPIO_Set_Input(U32BIT(I2C1_SDA),0); //设置为输入 不取反
PIN_Pullup_Disable(T_QFN_48, U32BIT(I2C1_SDA)); //关闭上拉输入
GPIO_Input_Disable(U32BIT(I2C1_SDA));
PIN_Set_GPIO(U32BIT(CS_PIN),PIN_SEL_GPIO);
GPIO_Set_Input(U32BIT(CS_PIN),0); //设置为输入 不取反
PIN_Pullup_Disable(T_QFN_48, U32BIT(CS_PIN)); //关闭上拉输入
GPIO_Input_Disable(U32BIT(CS_PIN));
PIN_Set_GPIO(U32BIT(ADCGP_IO),PIN_SEL_GPIO);
GPIO_Set_Input(U32BIT(ADCGP_IO),0); //设置为输入 不取反
PIN_Pullup_Disable(T_QFN_48, U32BIT(ADCGP_IO)); //关闭上拉输入
GPIO_Input_Disable(U32BIT(ADCGP_IO));
}
/*********************************************************************
* Function : work_timer_event
* Param in : none
@ -423,9 +480,11 @@ static void work_timer_event(void)
static void battery_timer_event(void)
{
static uint8_t count = 0;
static uint8_t times = 0;
if(times < 5)times++;
count++;
if(count>=3)
if(((count >= 3)&&(battery20s_flag == 1))||(times < 5))
{
count=0;
if((PAS.sleepCnt < (WORK_SLEEP_TIME - 10))&&(PAS.sleepFlag != 1)&&(PAS.sleepState != 1))
@ -434,6 +493,7 @@ static void battery_timer_event(void)
}
}
}
/*********************************************************************
* Function : LED_State_Indicator
* Param in : none
@ -529,8 +589,16 @@ void cal_battery_value(uint16_t adc)
PAS.batt_level = batteryPercentage;
}
#ifdef BATTERY_low_PROTECT
if(batteryVoltage<3.0)Battery_low=1;
else Battery_low=0;
if(batteryVoltage <= 3.0)
{
PAS.transpModes = 1;
Battery_low = 1;
}
else
{
if(Battery_low == 1)PAS.transpModes = 0;
Battery_low = 0;
}
#endif
#if ((1) && (defined(_DEBUG_) || defined(_SYD_RTT_DEBUG_)))
@ -1175,7 +1243,7 @@ static void timer_event_handler()
if(TIMER_EVT&EVT_1S_WORK)
{
work_timer_event();
Timer_Evt_Clr(EVT_1S_WORK);
}
#endif
@ -1185,6 +1253,8 @@ static void timer_event_handler()
{
LED_State_Indicator();
battery_timer_event();
#ifdef _WDT_
wdt_clear();
#endif
@ -1196,8 +1266,10 @@ static void timer_event_handler()
#ifdef EVT_20S_BATTERY
if(TIMER_EVT&EVT_20S_BATTERY)
{
battery20s_flag = 1;
//计算电池电量
battery_timer_event();
Timer_Evt_Clr(EVT_20S_BATTERY);
}
#endif

View File

@ -75,7 +75,11 @@
1、踏频硬件第二版修改了对应的硬件接口。
2、修改了电池电压采样放大倍速
2、修改了电池电压采样放大倍速和电池电量的计算。
3、增加当低电量时进入运输模式。
4、增加进入POWERDOWN时配置IO口防止漏电流进一步降低功耗 进入POWERDOWN模式时平均电流为12.5uA