diff --git a/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/inc/config.h b/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/inc/config.h index f4015ac..a12b58a 100644 --- a/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/inc/config.h +++ b/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/inc/config.h @@ -88,7 +88,7 @@ extern uint16_t system_1s_cnt; /****************project inforamtion MTP ADDR:0x100000C0*******************/ #define SOFT_WARE_VERISION_H 0x01 -#define SOFT_WARE_VERISION_L 0x00 +#define SOFT_WARE_VERISION_L 0x01 #define CUSTOM_ID 0xA1 #define PROJECT_ID 0x60 /**********************���칦�ܺ궨��************************************/ diff --git a/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/inc/customized.h b/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/inc/customized.h index a7f065b..b07a62f 100644 --- a/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/inc/customized.h +++ b/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/inc/customized.h @@ -50,13 +50,7 @@ extern bool usba_online_state; #define RS7D\ SOFT_WARE_VERISION_L -/* - 60°: 23.47 * 20uA = 469 - 85°: 10.28 * 20uA = 206 - 90°: 8.737 * 20uA = 175 - 100°: 6.39 * 20uA = 128 - 105°: 5.510 * 20uA = 110 -*/ + #define NTC_60 2299 #define NTC_85 1028 diff --git a/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/src/comp_dac.c b/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/src/comp_dac.c index 433fa70..1e448dc 100644 --- a/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/src/comp_dac.c +++ b/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/src/comp_dac.c @@ -455,7 +455,7 @@ static void comp_dac_cc_acdc(uint8_t port, uint16_t val, uint16_t offset) uint32_t value[TYPEC_PORT_MAX] = {0}; int16_t temp[TYPEC_PORT_MAX] = {0}; - //log_info("opto_set_cc port:%d cc_val:%d\n", port, val); + // log_info("opto_set_cc port:%d cc_val:%d offset:%d\n", port, val, offset); if(port == TYPEC_PORT0) { @@ -494,7 +494,7 @@ static void comp_dac_cc_acdc(uint8_t port, uint16_t val, uint16_t offset) else { // REG_DAC_CTRL_CC1_CFG->bf.target = value[port]; - comp_dac_cc_2dcdc_fb(port, val, offset); + comp_dac_cc_2dcdc_fb(port, val, CC1_LOOP_OFFSET); } } @@ -506,6 +506,8 @@ static void comp_dac_cc_acdc(uint8_t port, uint16_t val, uint16_t offset) */ void comp_dac_cc_target_set(uint8_t port, uint16_t val, uint16_t offset) { + uint16_t cc_offset[] = {CC0_LOOP_OFFSET, CC1_LOOP_OFFSET}; + if(port >= TYPEC_PORT_MAX) { return; @@ -522,23 +524,23 @@ void comp_dac_cc_target_set(uint8_t port, uint16_t val, uint16_t offset) if(user_app.type_c1_connect && !user_app.type_c2_connect) // 单C1 { - comp_dac_cc_acdc(TYPEC_PORT0, val, offset); + comp_dac_cc_acdc(TYPEC_PORT0, val, cc_offset[TYPEC_PORT0]); } else if(!user_app.type_c1_connect && user_app.type_c2_connect) // 单C2 { g_powerout_info[TYPEC_PORT0].set_current = val; - comp_dac_cc_acdc(TYPEC_PORT0, val, offset); - comp_dac_cc_2dcdc_fb(TYPEC_PORT1, val, offset); // 另外一路的电流也设到一样的 + comp_dac_cc_acdc(TYPEC_PORT0, val, cc_offset[TYPEC_PORT0]); + comp_dac_cc_2dcdc_fb(TYPEC_PORT1, val, cc_offset[TYPEC_PORT1]); // 另外一路的电流也设到一样的 } else // 双口 { if(port == TYPEC_PORT0) { - comp_dac_cc_acdc(TYPEC_PORT0, val, offset); + comp_dac_cc_acdc(TYPEC_PORT0, val, cc_offset[TYPEC_PORT0]); } else if(port == TYPEC_PORT1) { - comp_dac_cc_2dcdc_fb(TYPEC_PORT1, val, offset); + comp_dac_cc_2dcdc_fb(TYPEC_PORT1, val, cc_offset[TYPEC_PORT1]); } } diff --git a/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/src/customized.c b/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/src/customized.c index 328c620..97a5650 100644 --- a/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/src/customized.c +++ b/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/src/customized.c @@ -472,10 +472,12 @@ void usba_detection(void) { // 插入检测: 连续检测到 >=250mA电流 100ms // 拔出检测: 连续检测到 <100mA电流 3秒 + // 小功率设备判断: <= 650mA电流 10分钟 /* 实测: 0.1A = 47~50 0.25A = 121~124 + 0.65A = 325 */ uint16_t usba_current_adc = 0; @@ -514,10 +516,15 @@ void usba_detection(void) { seconds_cnt = 0; + // log_info("usba_adc:%d cnt:%d flag:%d\n", + // usba_current_adc, + // user_app.usba_low_current_cnt, + // user_app.usba_is_low_power); + // A口有负载在的时候小电流检测: 10分钟内小于300mA if(usba_online_state) { - if(usba_current_adc < VOLTAGE_0P13V) + if(usba_current_adc < VOLTAGE_0P32V) { // 确定是小功率设备后就不再计时 if(!user_app.usba_is_low_power) diff --git a/PD_CPS8860_A1_CPS_Common_Demo/ac_project/project/Objects/CPS8860_anker_9196.axf b/PD_CPS8860_A1_CPS_Common_Demo/ac_project/project/Objects/CPS8860_anker_9196.axf index 958e970..656df09 100644 Binary files a/PD_CPS8860_A1_CPS_Common_Demo/ac_project/project/Objects/CPS8860_anker_9196.axf and b/PD_CPS8860_A1_CPS_Common_Demo/ac_project/project/Objects/CPS8860_anker_9196.axf differ diff --git a/PD_CPS8860_A1_CPS_Common_Demo/ac_project/project/Objects/CPS8860_anker_9196.build_log.htm b/PD_CPS8860_A1_CPS_Common_Demo/ac_project/project/Objects/CPS8860_anker_9196.build_log.htm index a5df187..bb34a0d 100644 --- a/PD_CPS8860_A1_CPS_Common_Demo/ac_project/project/Objects/CPS8860_anker_9196.build_log.htm +++ b/PD_CPS8860_A1_CPS_Common_Demo/ac_project/project/Objects/CPS8860_anker_9196.build_log.htm @@ -30,6 +30,22 @@ Rebuild target 'Target 1' assembling startup_CMSDK_CM0.s... compiling adapter_antifake.c... compiling system_CMSDK_CM0.c... +compiling comp_auto_zero.c... +compiling app_spec.c... +..\..\common\app\src\app_spec.c(177): warning: #177-D: variable "umask_val" was declared but never referenced + uint32_t umask_val = 0; +..\..\common\app\src\app_spec.c: 1 warning, 0 errors +compiling port0_customized.c... +compiling main.c... +compiling cps8860_it.c... +compiling comp_primary_side.c... +compiling comp_adc.c... +compiling port1_customized.c... +compiling comp_discharge.c... +compiling dpdn_protocol.c... +compiling comp_protection.c... +compiling comp_powerout.c... +compiling qc_scp_protocol.c... compiling customized.c... ..\code\src\customized.c(26): warning: #188-D: enumerated type mixed with another type adapter_info_s g_adapter_info = {0}; @@ -37,29 +53,13 @@ compiling customized.c... user_app_s user_app = {0}; ..\code\src\customized.c(175): warning: #177-D: function "path_scp_mode_exit_action" was declared but never referenced static void path_scp_mode_exit_action(uint8_t port, scp_param_s *scp_param) -..\code\src\customized.c(1549): warning: #177-D: function "comp_ccloop_enable" was declared but never referenced +..\code\src\customized.c(1556): warning: #177-D: function "comp_ccloop_enable" was declared but never referenced static void comp_ccloop_enable(uint8_t port) ..\code\src\customized.c: 4 warnings, 0 errors -compiling comp_primary_side.c... -compiling comp_auto_zero.c... -compiling port0_customized.c... -compiling comp_powerout.c... -compiling cps8860_it.c... -compiling main.c... -compiling comp_discharge.c... -compiling app_spec.c... -..\..\common\app\src\app_spec.c(177): warning: #177-D: variable "umask_val" was declared but never referenced - uint32_t umask_val = 0; -..\..\common\app\src\app_spec.c: 1 warning, 0 errors -compiling comp_adc.c... -compiling port1_customized.c... compiling comp_dac.c... ..\code\src\comp_dac.c(311): warning: #177-D: variable "temp" was declared but never referenced uint32_t temp[TYPEC_PORT_MAX + 1] = {0}; ..\code\src\comp_dac.c: 1 warning, 0 errors -compiling comp_protection.c... -compiling dpdn_protocol.c... -compiling qc_scp_protocol.c... compiling ufcs_protocol.c... compiling pd_protocol.c... ..\..\common\comp\protocol\pd_protocol\src\pd_protocol.c(827): warning: #550-D: variable "pd_hw_uvdm_header" was set but never used @@ -68,7 +68,7 @@ compiling pd_protocol.c... static void pd_analog_set(uint8_t port) ..\..\common\comp\protocol\pd_protocol\src\pd_protocol.c: 2 warnings, 0 errors linking... -Program Size: Code=12630 RO-data=1910 RW-data=60 ZI-data=3872 +Program Size: Code=12650 RO-data=1910 RW-data=60 ZI-data=3872 FromELF: creating hex file... After Build - User command #1: .\CPS8860.bat C:\Users\TJP\Desktop\GIT_TEST\CPS8860_9196_70W\Anker_9196_CPS8860\PD_CPS8860_A1_CPS_Common_Demo\ac_project\project>set Project_Name=CPS8860_anker_9196 @@ -116,11 +116,11 @@ out_type : expected out file type 'd' output binary file(.bin) [out_file_name_without_postfix] : Option: out file name without postfix. ---------------------------------------------------------------------- -input code size: 14,600 [14.258K] - app size: 390C ; CRC: F832 +input code size: 14,620 [14.277K] + app size: 3920 ; CRC: 0379 -out code size : 14,604 [14.262K] -create file: .\output\CPS8860_anker_9196_A1_60_V1.0_CRC3A39.hex success! +out code size : 14,624 [14.281K] +create file: .\output\CPS8860_anker_9196_A1_60_V1.1_CRC3517.hex success! C:\Users\TJP\Desktop\GIT_TEST\CPS8860_9196_70W\Anker_9196_CPS8860\PD_CPS8860_A1_CPS_Common_Demo\ac_project\project>move /Y .\CPS8860_anker_9196_*.hex .\output һļҲļ ".\Objects\CPS8860_anker_9196.axf" - 0 Error(s), 8 Warning(s). @@ -136,7 +136,7 @@ Package Vendor: ARM D:\Keil_v5\ARM\PACK\ARM\CMSIS\5.8.0\Device\ARM\ARMCM0\Include

Collection of Component Files used:

-Build Time Elapsed: 00:00:07 +Build Time Elapsed: 00:00:06 diff --git a/PD_CPS8860_A1_CPS_Common_Demo/ac_project/project/Objects/CPS8860_anker_9196.htm b/PD_CPS8860_A1_CPS_Common_Demo/ac_project/project/Objects/CPS8860_anker_9196.htm index 162ed25..c82fdd6 100644 --- a/PD_CPS8860_A1_CPS_Common_Demo/ac_project/project/Objects/CPS8860_anker_9196.htm +++ b/PD_CPS8860_A1_CPS_Common_Demo/ac_project/project/Objects/CPS8860_anker_9196.htm @@ -3,9 +3,9 @@ Static Call Graph - [.\Objects\CPS8860_anker_9196.axf]

Static Call Graph for image .\Objects\CPS8860_anker_9196.axf


-

#<CALLGRAPH># ARM Linker, 5060960: Last Updated: Mon Aug 11 18:45:37 2025 +

#<CALLGRAPH># ARM Linker, 5060960: Last Updated: Wed Aug 13 18:24:25 2025

-

Maximum Stack Usage = 312 bytes + Unknown(Cycles, Untraceable Function Pointers)

+

Maximum Stack Usage = 320 bytes + Unknown(Cycles, Untraceable Function Pointers)

Call chain for Maximum Stack Depth:

main ⇒ app_spec_run ⇒ app_protocol_run ⇒ adapter_state_check ⇒ wait_c2_ready ⇒ pd_phy_open_vbus ⇒ adapter_state_check (Cycle)

@@ -575,7 +575,7 @@ Global Symbols
[Address Reference Count : 1]

SysTick_Handler (Thumb, 74 bytes, Stack size 8 bytes, cps8860_it.o(i.SysTick_Handler)) -

[Stack]