- /********************************************************************
- ** Function name: PIT_IRQHandler
- ** Descriptions: PIT 8KHz
- ** input parameters: none
- ** output parameters: none
- ** Returned value: none
- ** Created by:
- ** Created date
- **-------------------------------------------------------------------
- ** Modified by:
- ** Modified date:
- ********************************************************************/
- void PIT_IRQHandler(void)
- {
- PIT_T标志寄存器0 |= PIT_T标志寄存器_TIF_MASK;
- if(adcGetUint()<AD_Sample_Num/3)
- // 根据ad采样大小 3个led灯显示音量大小程度
- {
- Led5Set(1);
- Led6Set(0);
- Led7Set(0);
-
- }
- else if(adcGetUint()<2*AD_Sample_Num/3)
- {
- Led5Set(1);
- Led6Set(1);
- Led7Set(0);
-
- }
- else
- {
- Led5Set(1);
- Led6Set(1);
- Led7Set(1);
-
- }
- Volume=Volume_Num*adcGetUint()>>16;
- if(size2 < size1) dacTrigger(Buffer[FIFO_out]/(Volume_Num-Volume)); //语音输出
- FIFO_out++; //输出buffer下标+1
- size2++;
- if(FIFO_out>2047) //达到最大值,重置下标
- {
- FIFO_out=0;
- }
- }
- /********************************************************************
- END FILE
- ********************************************************************/
|