/* Including needed modules to compile this module/procedure */
#include "Cpu.h"
#include "Events.h"
#include "Pins1.h"
/* Including shared modules, which are used for whole project */
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
#include "PDD_Includes.h"
#include "Init_Config.h"
#include "ADfilter.h"
/* User includes (#include below this line is not maintained by Processor Expert) */
/*lint -save -e970 Disable MISRA rule (6.3) checking. */
int data1[1024];
float data2[1024];
float data3[1024];
float fir1[19]={
0.033256528597037163,
0,
-0.043820691684534403,
0,
0.062476446750844315,
0,
-0.10538980011793218,
0,
0.31807169085043557,
0.5,
0.31807169085043557,
0,
-0.10538980011793218,
0,
0.062476446750844315,
0,
-0.043820691684534403,
0,
0.033256528597037163
};
float fir2[19]={
-0.037713356941086018,
-0.0091433365478503816,
-0.083649880051877235,
-0.0030139606309280971,
-0.063317743594109022,
-0.081339263185699992,
0.040145318716597184,
-0.20639346860991459,
0.1422481855363216,
0.71522328387828549,
0.1422481855363216,
-0.20639346860991459,
0.040145318716597184,
-0.081339263185699992,
-0.063317743594109022,
-0.0030139606309280971,
-0.083649880051877235,
-0.0091433365478503816,
-0.037713356941086018
};
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
/* Write your local variable definition here */
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
PE_low_level_init();
/*** End of Processor Expert internal initialization. ***/
/* Write your code here */
/* For example: for(;;) { } */
syst_init();
int * aa;
double * bb;
double * cc;
aa=&data1[0];
bb=&data2[0];
cc=&data2[3];
//GPIOA_PDDR|=(1<<24); //时钟线GPIOA_PTD0口配置为输出
//GPIOA_PDDR|=(1<<25); //片选信号线GPIOA_PTD1口配置为输出
//GPIOB_PIDR&=~(1<<31); //gpiob_pth7输入禁止寄存器
//GPIOB_PDDR|=(1<<30); //Din线GPIOB_PTH6口配置为输出
//GPIOB_PDDR&=~(1<<31); //GPIOB_PTH7口配置为输入
while(1)
{
De_DC(data1,data2);
fir_filter(data2,fir1,1024,data3);
fir_512samp(data3,data2);
fir_filter(data2,fir1,512,data3);
fir_256samp(data3,data2);
fir_filter(data2,fir2,256,data3);
//sound_detect();
while(1);
}
/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
/*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
#ifdef PEX_RTOS_START
PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of RTOS startup code. ***/
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;;){}
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
/* END main */
/*!
** @}
*/
/*
** ###################################################################
**
** This file was created by Processor Expert 10.3 [05.09]
** for the Freescale Kinetis series of microcontrollers.
**
** ###################################################################
*/