采用二次复位,从PD切到别的协议也复位
1. 修改docs/更新日志.md,补充PD跨类别切换复位相关说明 2. 调整chrg_comm.c中协议切换复位判断条件,改为PD状态变化时复位 3. 更新代码注释,优化协议切换流程的说明逻辑
This commit is contained in:
@@ -2590,10 +2590,9 @@ static eMBException chrg_comm_apply_source_effect(rt_uint8_t ch,
|
||||
protocol_switch_requested = north_config_changed;
|
||||
new_pd_state = chrg_comm_source_pd_state(
|
||||
(rt_uint8_t)pShadow->source.protocol);
|
||||
/* 只有已知的非PD -> PD切换执行完整硬件复位。 */
|
||||
/* PD与非PD之间发生跨类别切换时执行完整硬件复位。 */
|
||||
old_pd_state = chrg_comm_source_pd_state((rt_uint8_t)old_protocol);
|
||||
need_source_reset = (old_pd_state == SOURCE_PD_STATE_NON_PD) &&
|
||||
(new_pd_state == SOURCE_PD_STATE_PD);
|
||||
need_source_reset = (old_pd_state != new_pd_state);
|
||||
target_curr = pShadow->source.pd_set.mm.max_cur;
|
||||
|
||||
/* 影子区只拥有COM配置;北向解析产生的运行目标和回读数据继续由pReal持有。 */
|
||||
@@ -2624,8 +2623,8 @@ static eMBException chrg_comm_apply_source_effect(rt_uint8_t ch,
|
||||
}
|
||||
|
||||
/*
|
||||
* PD配置或CC发生变化,以及从PD切换到非PD时,先断开CC;
|
||||
* 其它协议配置变化直接从0xD0开始。
|
||||
* PD配置或CC发生变化时进入切换流程;跨PD类别切换时先执行完整复位。
|
||||
* 同类别协议配置变化和仅CC切换直接从0xD0开始。
|
||||
*/
|
||||
if (north_config_changed) {
|
||||
chrg_roll_nor_source_switch_reset(ch);
|
||||
|
||||
Reference in New Issue
Block a user