|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2011-10-10 18:46:49
|
显示全部楼层
void TIM2_IRQHandler(void)
{
rt_interrupt_enter();
if ( TIM_GetITStatus(TIM2 , TIM_IT_Update) != RESET )
{
if(TIM_FLAG==0)
{
TDS_Control_A_SET
TDS_Control_B_CLE
TIM_FLAG=1;
}
else
{
TDS_Control_B_SET
TDS_Control_A_CLE
TIM_FLAG=0;
}
//每一百毫秒采样一次,三路通道分开采样
if(TIME_COUNT==(80+ADC1_TIME*100))
{
ADC1_VAL[ADC1_TIME++]=Get_Adc(0);
}
if(TIME_COUNT==(90+ADC2_TIME*100))
{
ADC2_VAL[ADC2_TIME++]=Get_Adc(1);
}
if(TIME_COUNT==(100+ADC3_TIME*100))
{
ADC3_VAL[ADC3_TIME++]=Get_Adc(3);
}
if(TIME_COUNT==1000)
{
TIME_COUNT=0;
rtgui_server_post_event(&emouse.parent, sizeof(struct rtgui_event_mouse));
}
TIME_COUNT++;
TIM_ClearITPendingBit(TIM2 , TIM_FLAG_Update);
}
rt_interrupt_leave();
} |
|