📄 main.c
字号:
#include "Initial.h"
int x[2000],xx[41],count=0;
int y[2000];
float coe[41] = {
-0.0007436801300972, -0.00966532650986, -0.02079295720964,-0.006728147279866,
0.01276276801358,-0.003885535116695,-0.009402874677733, 0.01441705620957,
-0.003612118610805, -0.01510028676103, 0.02177566575914,-0.003768139955797,
-0.02603025119696, 0.03545147857124,-0.003842964931381, -0.04890680053818,
0.06732459093614,-0.003812814832409, -0.1341317418805, 0.2766730386758,
0.6628425976257, 0.2766730386758, -0.1341317418805,-0.003812814832409,
0.06732459093614, -0.04890680053818,-0.003842964931381, 0.03545147857124,
-0.02603025119696,-0.003768139955797, 0.02177566575914, -0.01510028676103,
-0.003612118610805, 0.01441705620957,-0.009402874677733,-0.003885535116695,
0.01276276801358,-0.006728147279866, -0.02079295720964, -0.00966532650986,
-0.0007436801300972
};
extern int filter_start;
interrupt void BSP0_int() // Interrupt function
{
static int Data,m,i;
float inter=0;
Data = DRR10;
x[count]=Data;
for(i=0;i<40;i++)
xx[40-i]=xx[39-i];
xx[0]=Data;
for(i=0;i<41;i++)
inter=inter+xx[i]*coe[i];
y[count]=(int)inter;
DXR10 =y[count++]&0xFFFE;//(int)y[count]&0xFFFE;
if(count==1999)
count=0;
}
void main()
{
asm("\t ssbx intm"); // Interrupt disable
InitDSP();
InitMcBSP0();
InitAD50();
asm("\t rsbx intm"); // Interrupt enable
while(1)
{
asm("\t nop"); // Waiting for interrupt.
asm("\t nop");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -