这段中断服务程序是对AD采过来的数据进行处理,Sign是控制LCD显示的 ,显示程序在main里面的死循环,可是进入显示程序的时间太长(显示的数据太少),不上应该没进入一次DMA中断就显示一个数据吗,进入DMA中断的频率是400Hz左右,而LCD显示的频率只有5Hz左右,怎样才能使得1s传输的数据变多啊!
void DMA2_Stream0_IRQHandler(void)
{
uint16_t i ,k ;
//GPIO_ToggleBits(GPIOA,GPIO_Pin_1);
if(DMA_GetITStatus(DMA2_Stream0, DMA_IT_TCIF0))
{
DMA_ClearITPendingBit(DMA2_Stream0, DMA_IT_TCIF0);
if(ValueDataSign)ValueDataP = &ValueData1 ;
else ValueDataP = &ValueData2 ;
if(ValueDataP->ValuePointer>=200)ValueDataP->ValuePointer = 0 ;
ValueDataP->Press1Value[ValueDataP->ValuePointer] = 0 ;
ValueDataP->Press2Value[ValueDataP->ValuePointer] = 0 ;
ValueDataP->Press3Value[ValueDataP->ValuePointer] = 0 ;
ValueDataP->FLOW1Value[ValueDataP->ValuePointer] = 0 ;
ValueDataP->FLOW2Value[ValueDataP->ValuePointer] = 0 ;
ValueDataP->FLOW3Value[ValueDataP->ValuePointer] = 0 ;
ValueDataP->FLOW4Value[ValueDataP->ValuePointer] = 0 ;
temp[0] = 0 ;
temp[1] = 0 ;
temp[2] = 0 ;
for(i=0;i<AD_BUFFER_MAX;)
{
temp[0] += ADC3_ValueBuffer[i++] ;
temp[1] += ADC3_ValueBuffer[i++] ;
temp[2] += ADC3_ValueBuffer[i++] ;
ValueDataP->Press1Value[ValueDataP->ValuePointer] += ADC3_ValueBuffer[i++] ;
ValueDataP->Press2Value[ValueDataP->ValuePointer] += ADC3_ValueBuffer[i++] ;
ValueDataP->Press3Value[ValueDataP->ValuePointer] += ADC3_ValueBuffer[i++] ;
ValueDataP->FLOW1Value[ValueDataP->ValuePointer] += ADC3_ValueBuffer[i++] ;
ValueDataP->FLOW2Value[ValueDataP->ValuePointer] += ADC3_ValueBuffer[i++] ;
ValueDataP->FLOW3Value[ValueDataP->ValuePointer] += ADC3_ValueBuffer[i++] ;
ValueDataP->FLOW4Value[ValueDataP->ValuePointer] += ADC3_ValueBuffer[i++] ;
}
// ÐÞÕý
HeartRate = temp[0]/150 ;
Sign = 1 ;
// bsp_DelayUS(10);
// DMA_ClearITPendingBit(DMA2_Stream0, DMA_IT_TCIF0);
// GPIO_ToggleBits(GPIOA, GPIO_Pin_1) ;
}
} |