有关基于stm32的PMSM的FOC控制中u8 SVPWMEOCEvent(void)的一个问题

2019-07-14 23:34发布

本帖最后由 拉擦擦 于 2014-6-12 10:50 编辑

最近在做基于STM32的PMSM的FOC控制,2.0的库,单电阻采样的,感觉库函数中的u8 SVPWMEOCEvent(void)函数少了判断ADC何时第一次采样,何时第二次采样的语句,还有函数说明中说“Return false after first EOC, return true after second EOC ”的这条句话,好像没有实现这个功能的语句,什么时候也不能返回逻辑“false”啊?还是在别的函数中判断我没看到啊?




函数原型:
tica Neue, Helvetica, Arial, sans-serif">

/*******************************************************************************
* 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);

  return ((u8)(1));
}

友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。