芯方式

特定条件下Disable USB charging的方法

0
阅读(229) 评论(0)

Solution:
//add below
if(isAT_sleeptest & 0x40){//config your condition
ind = (bmt_usb_ind_struct
*)construct_local_para(sizeof(bmt_usb_ind_struct),TD_CTRL);
ind->usb_ind = PMU_CHARGE_CURRENT_0_00_MA;
USB_Send_Msg_Ext_Queue(ilm_charge, MOD_BMT, MSG_ID_BMT_USB_IND, ind);
}
else{
//add above
// drag 500 mA current
if (bmt_support_usb_charge() == KAL_TRUE) // force USB charging
{
ind = (bmt_usb_ind_struct*)construct_local_para(sizeof(bmt_usb_ind_struct),
TD_CTRL);
ind->usb_ind =

ICFANS
(PMU_CHR_CURRENT_ENUM)gUsbDevice.get_chr_current_list.pCurrentList[gUsbDevice.current_t
able_index - 1];
USB_Send_Msg_Ext_Queue(ilm_charge,MOD_BMT, MSG_ID_BMT_USB_IND, ind);
}
else
{
// drag min current or do not drag current
// if ((kal_uint32)gUsbDevice.get_chr_current_list.pCurrentList[0] < 10000)
// {
// ind = (bmt_usb_ind_struct*)construct_local_para(sizeof(bmt_usb_ind_struct),
TD_CTRL);
// ind->usb_ind =
(PMU_CHR_CURRENT_ENUM)gUsbDevice.get_chr_current_list.pCurrentList[0];
// USB_Send_Msg_Ext_Queue(ilm_charge, MOD_BMT, MSG_ID_BMT_USB_IND, ind);
// }
}
}