1、完成所有功能。

This commit is contained in:
DESKTOP-BUI7OAO\15586 2025-06-20 14:26:06 +08:00
parent e7ba4c5644
commit 40e1ae35a3
57 changed files with 57375 additions and 56939 deletions

View File

@ -77,8 +77,7 @@ void Ctr_IO_Config(void)
//电池采样控制引脚
PIN_Set_GPIO(U32BIT(CEN_PIN),PIN_SEL_GPIO); //引脚设置成普通IO口
GPIO_Set_Output(U32BIT(CEN_PIN)); //设置引脚为输出模式
CEN_ENABLE();
CEN_ENABLE();
}
/*************************************************************************************************
* Function Name:

View File

@ -13,6 +13,7 @@
#include "mcu_bsp.h"
#include "DebugLog.h"
extern uint8_t work_led_count;
/*********************************************************************
* Global Variables (declared in header file with 'extern')
*/
@ -48,11 +49,12 @@ void Lis2dh_Init(void)
if(temp == LIS2DH12_ID)
{
//dbg_printf("lis2dh exist\r\n");
// dbg_printf("lis2dh exist\r\n");
}
else
{
// dbg_printf("lis2dh not exist\r\n");
// dbg_printf("lis2dh not exist\r\n");
work_led_count = 8;
}
//软件复位, 寄存器到默认配值
@ -100,11 +102,11 @@ void Lis2dh_Act_State_Judge(void)
{
if((GPIO_Pin_Read(U32BIT(LIS2D_INT2)) & U32BIT(LIS2D_INT2))!= 0)
{
dbg_printf("Act_State\r\n");
// dbg_printf("Act_State\r\n");
}
else
{
dbg_printf("Inact_State\r\n");
// dbg_printf("Inact_State\r\n");
}
}
/*************************************************************************************************

View File

@ -12,6 +12,8 @@
#include "delay.h"
#include "mcu_bsp.h"
#include "DebugLog.h"
extern uint8_t work_led_count;
/*********************************************************************
* Global Variables (declared in header file with 'extern')
*/
@ -61,10 +63,13 @@ void Lsm6dso_Init(void)
if(temp == LSM6DSO_ID)
{
PAS.exist = 1;
// dbg_printf("LSM6DSO exist\r\n");
}
else
{
PAS.exist = 0;
work_led_count = 4;
// dbg_printf("LSM6DSO not exist\r\n");
}
//软件复位, 寄存器到默认配值

View File

@ -37,6 +37,7 @@ typedef struct
{
uint8_t exist;
uint8_t batt_level;
uint16_t batt_vol;
int16_t RPM;
int16_t angle;
uint8_t actFlag;
@ -45,7 +46,8 @@ typedef struct
uint8_t sleepFlag;
uint8_t sleepState;
uint8_t chargeState;
uint8_t transpModes; //ÔËÊäģʽ±ê־λ
uint32_t transpModes; //运输模式标志位 注意要占4个字节否则Flash数据保存标志位的时候会出问题
uint8_t exitTransmode; //退出运输模式标志
} PAS_SENSOR_t;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@ Dialog DLL: TARMCM1.DLL V1.14.2.0
<h2>Project:</h2>
C:\Users\15586\Documents\PASII\CandeII_1.4\User\KEIL\Syd8811_Peripheral.uvprojx
Project File Date: 06/09/2025
Project File Date: 06/20/2025
<h2>Output:</h2>
*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'D:\Keil_v5\ARM\ARMCC\Bin'
@ -32,9 +32,9 @@ hex2bin v1.0.6, Copyright (C) 1998 Jacques Pelletier
checksum extensions Copyright (C) 2004 Rockwell Automation
improved P.G. 2007
Lowest address = 00000000
Highest address = 00015D8B
Highest address = 00015E4F
Pad Byte = FF
8-bit Checksum = 2A
8-bit Checksum = 59
After Build - User command #2: fromelf -c .\output\Syd8811_Peripheral.axf -o .\output\Syd52832_Peripheral.txt
".\Output\Syd8811_Peripheral.axf" - 0 Error(s), 0 Warning(s).
@ -57,9 +57,9 @@ Package Vendor: ARM
* Component: ARM::CMSIS:CORE:5.4.0
* Component: ARM::Device:Startup:1.2.2
Include file: Device\ARM\ARMCM0\Include\ARMCM0.h
Source file: Device\ARM\ARMCM0\Source\system_ARMCM0.c
Source file: Device\ARM\ARMCM0\Source\ARM\startup_ARMCM0.s
Include file: Device\ARM\ARMCM0\Include\ARMCM0.h
Build Time Elapsed: 00:00:01
</pre>
</body>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -70,7 +70,7 @@ I (..\..\User\config.h)(0x68479A42)
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)
I (..\..\Include\wdt.h)(0x684A2FEF)
I (..\..\Include\wdt.h)(0x6853B91B)
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)
I (D:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5EC775FC)
@ -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)(0x684A5064)(-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)(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)
I (..\..\App\app_gpio.h)(0x684673D7)
I (..\..\Include\gpio.h)(0x684673D7)
I (..\..\Include\ARMCM0.h)(0x684673D7)
@ -134,7 +134,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\Device\ARM\ARMCM0\Include\system_ARMCM0.h)(0x5E8ED12A)
I (..\..\Lib\lib.h)(0x684673D7)
I (..\..\Include\i2c.h)(0x684673D7)
I (..\..\User\mcu_bsp.h)(0x684673D7)
I (..\..\User\mcu_bsp.h)(0x685375DD)
F (..\..\App\app_timer.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\app_timer.o --omf_browse .\output\app_timer.crf --depend .\output\app_timer.d)
I (..\..\App\app_timer.h)(0x684673D7)
I (..\..\Include\timer.h)(0x684673D7)
@ -155,10 +155,10 @@ 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\mcu_bsp.h)(0x684673D7)
I (..\..\User\mcu_bsp.h)(0x685375DD)
I (..\..\Include\gpio.h)(0x684673D7)
I (..\..\Lib\lib.h)(0x684673D7)
F (..\..\Hardware\lis2dh.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\lis2dh.o --omf_browse .\output\lis2dh.crf --depend .\output\lis2dh.d)
F (..\..\Hardware\lis2dh.c)(0x685360FA)(-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\lis2dh.o --omf_browse .\output\lis2dh.crf --depend .\output\lis2dh.d)
I (..\..\Hardware\lis2dh.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)
@ -174,13 +174,13 @@ I (..\..\Include\delay.h)(0x684673D7)
I (..\..\Include\gpio.h)(0x684673D7)
I (..\..\Lib\lib.h)(0x684673D7)
I (..\..\Include\i2c.h)(0x684673D7)
I (..\..\User\mcu_bsp.h)(0x684673D7)
I (..\..\User\mcu_bsp.h)(0x685375DD)
I (..\..\Rtt\DebugLog.h)(0x684673D7)
I (..\..\User\config.h)(0x68479A42)
I (..\..\Rtt\SEGGER_RTT.h)(0x684673D7)
I (..\..\Rtt\SEGGER_RTT_Conf.h)(0x684673D7)
F (..\..\Hardware\lsm6d.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\lsm6d.o --omf_browse .\output\lsm6d.crf --depend .\output\lsm6d.d)
I (..\..\Hardware\lsm6d.h)(0x684A7514)
F (..\..\Hardware\lsm6d.c)(0x68535EEB)(-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)
I (..\..\Hardware\lsm6d.h)(0x6853E2F7)
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)
I (D:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5EC775FC)
@ -195,7 +195,7 @@ I (..\..\Include\gpio.h)(0x684673D7)
I (..\..\Lib\lib.h)(0x684673D7)
I (..\..\Include\i2c.h)(0x684673D7)
I (..\..\Include\delay.h)(0x684673D7)
I (..\..\User\mcu_bsp.h)(0x684673D7)
I (..\..\User\mcu_bsp.h)(0x685375DD)
I (..\..\Rtt\DebugLog.h)(0x684673D7)
I (..\..\User\config.h)(0x68479A42)
I (..\..\Rtt\SEGGER_RTT.h)(0x684673D7)
@ -228,8 +228,8 @@ 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)(0x684A7514)(-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)(0x684673D7)
F (..\main.c)(0x6853ED81)(-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)(0x685375DD)
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)
I (D:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5EC775FC)
@ -239,7 +239,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\Device\ARM\ARMCM0\Include\system_ARMCM0.h)(0x5E8ED12A)
I (..\..\Include\gpio.h)(0x684673D7)
I (..\..\Lib\lib.h)(0x684673D7)
I (..\..\Hardware\lsm6d.h)(0x684A7514)
I (..\..\Hardware\lsm6d.h)(0x6853E2F7)
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)
@ -255,7 +255,7 @@ I (D:\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x5EC775FC)
I (D:\Keil_v5\ARM\ARMCC\include\string.h)(0x5EC77604)
I (..\..\Hardware\crc16.h)(0x684673D7)
I (..\..\Hardware\common.h)(0x684673D7)
I (..\..\Include\wdt.h)(0x684A2FEF)
I (..\..\Include\wdt.h)(0x6853B91B)
I (..\..\Rtt\DebugLog.h)(0x684673D7)
I (..\..\Rtt\SEGGER_RTT.h)(0x684673D7)
I (..\..\Rtt\SEGGER_RTT_Conf.h)(0x684673D7)
@ -263,8 +263,8 @@ I (..\..\Lib\softtimer.h)(0x684673D7)
I (..\..\App\app_timer.h)(0x684673D7)
I (..\..\Include\timer.h)(0x684673D7)
I (..\SYD_ble_service_service.h)(0x684673D7)
F (..\mcu_bsp.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\mcu_bsp.o --omf_browse .\output\mcu_bsp.crf --depend .\output\mcu_bsp.d)
I (..\mcu_bsp.h)(0x684673D7)
F (..\mcu_bsp.c)(0x685236F4)(-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\mcu_bsp.o --omf_browse .\output\mcu_bsp.crf --depend .\output\mcu_bsp.d)
I (..\mcu_bsp.h)(0x685375DD)
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)
I (D:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5EC775FC)
@ -280,8 +280,8 @@ I (..\..\App\app_timer.h)(0x684673D7)
I (..\..\Include\timer.h)(0x684673D7)
I (..\..\App\app_adc.h)(0x684673D7)
I (..\..\Include\gpadc.h)(0x684673D7)
F (..\isr.c)(0x684A5064)(-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\isr.o --omf_browse .\output\isr.crf --depend .\output\isr.d)
I (..\mcu_bsp.h)(0x684673D7)
F (..\isr.c)(0x68537C04)(-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\isr.o --omf_browse .\output\isr.crf --depend .\output\isr.d)
I (..\mcu_bsp.h)(0x685375DD)
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)
I (D:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5EC775FC)
@ -291,7 +291,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\Device\ARM\ARMCM0\Include\system_ARMCM0.h)(0x5E8ED12A)
I (..\..\Include\gpio.h)(0x684673D7)
I (..\..\Lib\lib.h)(0x684673D7)
I (..\..\Hardware\lsm6d.h)(0x684A7514)
I (..\..\Hardware\lsm6d.h)(0x6853E2F7)
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)
@ -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)(0x684A79B3)()
F (..\..\doc.txt)(0x6854F9A7)()
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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -113,14 +113,14 @@
<tDllPa></tDllPa>
<tDlgDll></tDlgDll>
<tDlgPa></tDlgPa>
<tIfile></tIfile>
<tIfile>.\debug.ini</tIfile>
<pMon>Segger\JL2CM3.dll</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
<Key>DLGUARM</Key>
<Name>d</Name>
<Name></Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
@ -456,7 +456,7 @@
<Group>
<GroupName>App</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>

View File

@ -139,7 +139,7 @@
<bUseTDR>1</bUseTDR>
<Flash2>BIN\UL2CM3.DLL</Flash2>
<Flash3>"" ()</Flash3>
<Flash4></Flash4>
<Flash4>.\debug.ini</Flash4>
<pFcarmOut></pFcarmOut>
<pFcarmGrp></pFcarmGrp>
<pFcArmRoot></pFcArmRoot>

View File

@ -0,0 +1,7 @@
/***********************************************************************/
/* FLASH.INI: Flash Initialization File */
/***********************************************************************/
_WBYTE (0x5000100D, 0x00);
_sleep_(10);
RESET

View File

@ -54,7 +54,11 @@ void GPIO_callback(void)
{
if((GPIO_Pin_Read(U32BIT(CHARGE_STATE_PIN)) & U32BIT(CHARGE_STATE_PIN))!= 0)
{
if(PAS.transpModes == 1)
{
PAS.transpModes = 0;
PAS.exitTransmode = 1;
}
}
}
}

View File

@ -28,7 +28,7 @@
//变量定义
Tx_Buffer_t dtts_tx_buffer; // 存放发送给主机的数据
static struct gap_ble_addr dev_addr;
static uint8_t work_led_count = 6;
uint8_t work_led_count = 6;
/* 设置配置数组 */
static uint8_t Device_Name_Array[Device_Name_Len]= {Device_Name};
/* this is for change the byte to char*/
@ -119,7 +119,9 @@ void JsProtocol_Report(int16_t MasterValue,int16_t SlaveValue,int16_t FunCodeVal
int main()
{
__disable_irq();
delay_ms(10);
/* 蓝牙初始化系统主时钟初始化64M,32K时钟初始化为LPO */
ble_init();
@ -155,6 +157,7 @@ int main()
Timer_Evt_Start(EVT_1S_WORK);
Timer_Evt_Start(EVT_1S_OTA);
Timer_Evt_Start(EVT_300MS_PACK);
Timer_Evt_Start(EVT_20S_BATTERY);
/*5 seconds wdt*/
#ifdef _WDT_
@ -168,8 +171,14 @@ int main()
StartAdv(); //开始广播
Adv_State = 1;
ReadFlashData(FLASH_INTERNAL_DATA_ADDR, sizeof(PAS.transpModes), (unsigned char*)&PAS.transpModes);
dbg_printf("transpModes = %d\r\n",PAS.transpModes);
__enable_irq();
get_battery_value(); //上电或者POWNDOWN唤醒时计算一次电量
while(1)
{
@ -204,7 +213,13 @@ void Charge_State_Judge(void)
{
if((GPIO_Pin_Read(U32BIT(CHARGE_STATE_PIN)) & U32BIT(CHARGE_STATE_PIN))!= 0)
{
PAS.chargeState = 1;
PAS.chargeState = 1;
if(PAS.transpModes == 1)
{
PAS.transpModes = 0;
PAS.exitTransmode = 1;
}
}
else
{
@ -311,19 +326,32 @@ static void PowerDown(void)
Lsm6dso_Disable();
PEN_DISABLE();
CEN_DISABLE(); // 母线电压采样MOS关闭
pw_cfg.wakeup_type = POWERDOWN_WAKEUP;
pw_cfg.wdt_wakeup_en = (bool)false;
pw_cfg.rtc_wakeup_en = (bool)false;
pw_cfg.timer_wakeup_en = (bool)false;
pw_cfg.gpi_wakeup_en = (bool)true;
if(PAS.transpModes == 1)
{
pw_cfg.gpi_wakeup_cfg = U32BIT(CHARGE_STATE_PIN); //中断唤醒pin
pw_cfg.gpi_wakeup_cfg = U32BIT(CHARGE_STATE_PIN); //中断唤醒pin
EraseFlashData(FLASH_INTERNAL_DATA_ADDR,1);
WriteFlashData(FLASH_INTERNAL_DATA_ADDR,sizeof(PAS.transpModes), (unsigned char*)&PAS.transpModes);
}
else
{
pw_cfg.gpi_wakeup_cfg = U32BIT(LIS2D_INT2); //中断唤醒pin
if(PAS.exitTransmode)
{
PAS.exitTransmode = 0;
EraseFlashData(FLASH_INTERNAL_DATA_ADDR,1);
WriteFlashData(FLASH_INTERNAL_DATA_ADDR,sizeof(PAS.transpModes), (unsigned char*)&PAS.transpModes);
}
}
WakeupConfig(&pw_cfg);
@ -343,7 +371,6 @@ static void PowerDown(void)
static void work_timer_event(void)
{
/*****************判断是否进入POWERDOWN状态***********************/
if(connect_flag == 1)
{
if(PAS.RPM == 0)
@ -387,6 +414,27 @@ static void work_timer_event(void)
}
}
}
/*********************************************************************
* Function : battery_timer_event
* Param in : none
* Param out: none
* Return : none
* Describe : get battery event, it be called every 20s
*/
static void battery_timer_event(void)
{
static uint8_t count = 0;
count++;
if(count>=3)
{
count=0;
if((PAS.sleepCnt < (WORK_SLEEP_TIME - 10))&&(PAS.sleepFlag != 1)&&(PAS.sleepState != 1))
{
get_battery_value();
}
}
}
/*********************************************************************
* Function : LED_State_Indicator
* Param in : none
@ -432,8 +480,11 @@ void LED_State_Indicator(void)
uint8_t get_battery_value()
{
GPADC_channel_sel(ADCGP_CH);
syd_nosleep((bool)true,SYD_NOSLEEP_ADC);
GPADC_start(cal_battery_value);
syd_nosleep((bool)true,SYD_NOSLEEP_ADC);
if(connect_flag)
{
BLE_NotifyBatteryLevel();
@ -458,16 +509,19 @@ void cal_battery_value(uint16_t adc)
{
float batteryVoltage=0.0;
batteryVoltage=(float)adc*3.6/1024;
/* 转换为电池电压*/
batteryVoltage = batteryVoltage*4/3+0.04;
// PAS.batt_vol = batteryVoltage*100;
#if ((1) && (defined(_DEBUG_) || defined(_SYD_RTT_DEBUG_)))
dbg_printf("pin_vol:%4.3f ",batteryVoltage);
#endif
/* 转换为电池电压*/
batteryVoltage = batteryVoltage*4/3+0.04;
batteryPercentage = (batteryVoltage*1000-3000)/11.5+0.5;
if(batteryPercentage<0)batteryPercentage=0;
if(batteryPercentage>100)batteryPercentage=100;
// lvbu_pas_sensor.batt_level=batteryPercentage;
if(batteryPercentage < 0)batteryPercentage=0;
if(batteryPercentage > 100)batteryPercentage=100;
count++;
if(count>=2)count=0;
batteryPercenttemp[count]=batteryPercentage;
@ -490,6 +544,7 @@ void cal_battery_value(uint16_t adc)
dbg_printf("battery adc Err \r\n");
#endif
}
syd_nosleep((bool)false,SYD_NOSLEEP_ADC);
}
/*********************************************************************
@ -542,7 +597,7 @@ static void ble_init()
struct gap_wakeup_config pw_cfg;
BleInit();
SetWinWideMinusCnt(1);
GetGATTReportHandle(&g_report);
@ -1137,6 +1192,8 @@ static void timer_event_handler()
#ifdef EVT_20S_BATTERY
if(TIMER_EVT&EVT_20S_BATTERY)
{
//计算电池电量
battery_timer_event();
Timer_Evt_Clr(EVT_20S_BATTERY);
}
#endif
@ -1389,7 +1446,7 @@ static void timer_1_callback(void)
void JsProtocol_Report(int16_t MasterValue,int16_t SlaveValue,int16_t FunCodeValue,
char* Key1,int16_t Value1,char* Key2,int16_t Value2)
{
int i=0;
int i=0;
cJSON* JsFrameTx_Report=NULL; //new一个响应的的json主体
cJSON* JsTx_Data=NULL; //new一个响应的的json主体
int16_t TxJs_Len; //保存json包长度

View File

@ -28,7 +28,7 @@ void BSP_MCU_Config(void)
{
BSP_GPIOConfig();
BSP_TimerConfig();
//BSP_ADCConfig();
BSP_ADCConfig();
}
/*************************************************************************************************
* Function Name:

View File

@ -14,7 +14,12 @@
*/
#include "ARMCM0.h"
#include "gpio.h"
/*
Flash
*/
#define FLASH_INTERNAL_DATA_ADDR 0 //(0x080000-0x2000)
/*
LED IO
*/
@ -64,7 +69,6 @@ ADC ͨ
#define ADCGP_IO GPIO_30
#define ADCGP_CH ADCGP_CH6
/*********************************************************************
* Global Function declared ('extern')
*/

View File

@ -54,6 +54,23 @@
4、增加运输模式在运输模式时进入POWERDOWN只有充电时从POWERDOWN唤醒。
5、基本完成踏频的所用功能除电量显示外。
2025.6.18
1、增加电量显示功能
2025.6.19
1、增加故障灯 正常情况开机或者唤醒闪烁3下
LSM6DSO故障时开机或者唤醒闪烁2下
LIS2DH12故障时开机或者唤醒闪烁4下
2、增加了flash的数据存储的数据写保存运输模式的标志位注意4K设置中也要设置flash 数据去的大小;
2025.6.20
1、硬件上SWD的烧录引脚的下拉电阻改成4.7K否者keil烧录有问题;