Question
u8 SVPWMEOCEvent(void) function in motor library V2.0
Posted on September 26, 2014 at 04:52
This routine to be performed inside the end of conversion ISR,from the function ,we can see that the ext. adc triggeringis disable when the motor state is RUN.So,how can we to trigrer AD conversion for the next time?
/******************************************************************************* * Function Name : SVPWMEOCEvent * Description : Routine to be performed inside the end of conversion ISR It computes the bus voltage and temperature sensor sampling and disable the ext. adc triggering. * Input : None * Output : None * Return : None *******************************************************************************/ u8 SVPWMEOCEvent(void) { // Store the Bus Voltage and temperature sampled values h_ADCTemp = ADC_GetInjectedConversionValue(ADC2,ADC_InjectedChannel_2); h_ADCBusvolt = ADC_GetInjectedConversionValue(ADC1,ADC_InjectedChannel_2); if ((State == START) || (State == RUN)) { // Disable EXT. ADC Triggering ADC1->CR2 = ADC1->CR2 & 0xFFFF7FFF; } return ((u8)(1)); } void ADC1_2_IRQHandler(void) { //if(ADC_GetITStatus(ADC1, ADC_IT_JEOC) == SET)) if((ADC1->SR & ADC_FLAG_JEOC) == ADC_FLAG_JEOC) { //It clear JEOC flag ADC1->SR = ~(u32)ADC_FLAG_JEOC; if (SVPWMEOCEvent()) { ......