|
void CHRDET_HISR(void)
// 根据USB 或者CHARGER是否PLUG IN,设置gCHRDET_EINT_NO极性
chrdet_level_config(BMT.EINT2STATE);
// 设置状态 bmt_set_chr_status
if (state == DETECTCHRIN)
{
#ifdef BMT_DEBUG
dbg_printWithTime("CHARGER_PLUGIN\r\n");
#endif
bmt_set_chr_status(bmt_chr_in);//×¢²áMSG
#ifndef __DRV_NO_USB_CHARGER__
bmt_charger_action(KAL_TRUE);
#endif
}
else
{
#ifdef BMT_DEBUG
dbg_printWithTime("CHARGER_PLUGOUT\r\n");
#endif
bmt_set_chr_status(bmt_chr_out);//×¢²áMSG
#ifndef __DRV_NO_USB_CHARGER__
bmt_charger_action(KAL_FALSE);
#endif
}
//注册MSG,发送
void bmt_set_chr_status(Charger_Status status)
{
g_ucChargerStatus = status;
if (chr_read_flag == 0)
{
chr_read_flag = 1;
BMT_sendMes
(MOD_EINT_HISR/*MOD_BMT*/,MSG_ID_BMT_CHARGER_IND);//send
message to BMT task
}
} |
|