void BLDC_PWM_FaultCallback(void *device, uint32_t wpara, uint32_t lpara)
{
if (PWM_GetOverflowFlag(PWM1))
{
#ifdef USE_USER_ADC_DRIVER
PWM_CNTOF_CallBack();
// PWM_ClrOverFlowFlag(PWM1);
#endif
// PWM_ClrOverFlowFlag(PWM1);
}
if (PWM_GetFaultChannelFlag(PWM1, (uint16_t)PWM_FAULT_CH_1))
{
g_mcStatus = FAULT;
g_bldc_protector.faultFlag.bits.hwFault = 1;
PWM_ClearFaultChannelFlag(PWM1, (uint16_t)PWM_FAULT_CH_1);
}
}
是在中断后的回调函数中读的CNTOF的标识位. |