最近在做基于stm32的PMSM的FOC控制,2.0的库,单电阻采样的,感觉库函数中的u8 SVPWMEOCEvent(void)函数少了判断ADC何时第一次采样,何时第二次采样的语句,还有函数说明中说“Return false after first EOC, return true after second EOC ”的这条句话,好像没有实现这个功能的语句,什么时候也不能返回逻辑“false”啊?还是在别的函数中判断我没看到啊?
/*******************************************************************************
* Function Name : SVPWMEOCEvent
* Description : Routine to be performed inside the end of conversion ISR
store the first sampled value and compute the bus voltage and temperature
sensor sampling and disable the ext. adc triggering.
* Input : None
* Output : Return false after first EOC, return true after second EOC
* Return : None
*******************************************************************************/
u8 SVPWMEOCEvent(void)
{
if (bDistEnab == 1)
{
// Diabling the Injectec conversion for ADC1
ADC_ExternalTrigInjectedConvCmd(ADC1,DISABLE);
}
// Store the Bus Voltage and temperature sampled values
h_ADCTemp = ADC_GetInjectedConversionValue(ADC2,ADC_InjectedChannel_1);
h_ADCBusvolt = ADC_GetInjectedConversionValue(ADC2,ADC_InjectedChannel_2);