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 45b2fc8..f4015ac 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 @@ -87,8 +87,8 @@ extern uint16_t system_1s_cnt; #define I2C_DC_SUPPORT 0 /****************project inforamtion MTP ADDR:0x100000C0*******************/ -#define SOFT_WARE_VERISION_H 0x00 -#define SOFT_WARE_VERISION_L 0x09 +#define SOFT_WARE_VERISION_H 0x01 +#define SOFT_WARE_VERISION_L 0x00 #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 a7f4503..a7f065b 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 @@ -128,6 +128,7 @@ typedef struct bool protection_off_flag[2]; bool protect_en; //保护是否使能 + volatile uint16_t protection_exit_cnt; // 退出保护后计数 #if HUAWEI_MATEBOOK_X uint16_t matebook_cnt_3s[2]; diff --git a/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/src/comp_protection.c b/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/src/comp_protection.c index 482b1a9..d1b28e7 100644 --- a/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/src/comp_protection.c +++ b/PD_CPS8860_A1_CPS_Common_Demo/ac_project/code/src/comp_protection.c @@ -563,6 +563,8 @@ static void comp_protection_exit(uint8_t port, protection_param_s *protection_pa typec_reset(port, &g_app_protocol_param[port].pd_param); #endif protection_param->protection_flag = false; + + user_app.protection_exit_cnt = DELAY_300MS; } /** 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 a867f62..328c620 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 @@ -754,6 +754,14 @@ void adapter_state_check(void) type_c2_state = user_app.type_c2_connect; usba_state = usba_online_state; + // 从保护状态退出时, 等300ms后再去走状态机 + // 1. 保护的端口还在, 跑状态机的话, pdo和mos都会去切, 导致没问题的端口不停的发新的src_cap + // 2. 得防止保护退出后typec_reset 后 调用 app_protocol_reset 会把插入标志位给清了 + if(user_app.protection_exit_cnt) + { + return; + } + if(type_c1_state && !type_c2_state && !usba_state) { user_app.adapter_state = C1_INSER; @@ -834,8 +842,8 @@ void adapter_state_check(void) // 每次切换gate2和gate3的时候, 关闭2秒保护, 2秒后且在ready状态再打开 comp_powerout_protect_en(TYPEC_PORT0, false); comp_powerout_protect_en(TYPEC_PORT1, false); - user_app.protection_off_2s[TYPEC_PORT0] = DELAY_2S; - user_app.protection_off_2s[TYPEC_PORT1] = DELAY_2S; + user_app.protection_off_2s[TYPEC_PORT0] = DELAY_4S; + user_app.protection_off_2s[TYPEC_PORT1] = DELAY_4S; user_app.protection_off_flag[TYPEC_PORT0] = true; user_app.protection_off_flag[TYPEC_PORT1] = true; #endif @@ -1197,10 +1205,11 @@ void adapter_state_check(void) } } - log_info("adapter_state:%d port0:%d port1:%d\n", + log_info("adapter_state:%d port0:%d port1:%d usba:%d\n", user_app.adapter_state, need_send_cap_flag[TYPEC_PORT0], - need_send_cap_flag[TYPEC_PORT1]); + need_send_cap_flag[TYPEC_PORT1], + usba_state); user_app.last_adapter_state = user_app.adapter_state; } 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 4075a72..958e970 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 5778fb7..a5df187 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,24 +30,6 @@ Rebuild target 'Target 1' assembling startup_CMSDK_CM0.s... compiling adapter_antifake.c... compiling system_CMSDK_CM0.c... -compiling cps8860_it.c... -compiling comp_auto_zero.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_discharge.c... -compiling comp_primary_side.c... -compiling port0_customized.c... -compiling main.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_protection.c... -compiling comp_adc.c... -compiling port1_customized.c... -compiling comp_powerout.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}; @@ -55,20 +37,38 @@ 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(1540): warning: #177-D: function "comp_ccloop_enable" was declared but never referenced +..\code\src\customized.c(1549): 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 pd_hw_uvdm_header_u pd_hw_uvdm_header = {0}; ..\..\common\comp\protocol\pd_protocol\src\pd_protocol.c(275): warning: #177-D: function "pd_analog_set" was declared but never referenced static void pd_analog_set(uint8_t port) ..\..\common\comp\protocol\pd_protocol\src\pd_protocol.c: 2 warnings, 0 errors -compiling ufcs_protocol.c... linking... -Program Size: Code=12638 RO-data=1910 RW-data=60 ZI-data=3864 +Program Size: Code=12630 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 @@ -80,8 +80,8 @@ C:\Users\TJP\Desktop\GIT_TEST\CPS8860_9196_70W\Anker_9196_CPS8860\PD_CPS8860_A1_ δı code\src\comp_primary_side.c δı code\src\comp_protection.c δı code\src\customized.c -ʽ code\src\port0_customized.c -ʽ code\src\port1_customized.c +δı code\src\port0_customized.c +δı code\src\port1_customized.c ------------------------------------------------------------ Ŀ¼ ..\*.h ------------------------------------------------------------ @@ -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,608 [14.266K] - app size: 3914 ; CRC: E913 +input code size: 14,600 [14.258K] + app size: 390C ; CRC: F832 -out code size : 14,612 [14.270K] -create file: .\output\CPS8860_anker_9196_A1_60_V0.9_CRCD375.hex success! +out code size : 14,604 [14.262K] +create file: .\output\CPS8860_anker_9196_A1_60_V1.0_CRC3A39.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