[ create a new paste ] login | about

Link: http://codepad.org/ogqLPpEd    [ raw code | output | fork ]

C, pasted on Aug 20:
arm_cfft_radix2_instance_q15 fftInstance;
static u32 curInputCursor=0;
static u32 dataIsReady = 0;
static q15_t input [2048]; /**< input points */
static q15_t output [1024]; /**< output frequency characteristic */

/** @brief Timer interrupt handler. Frequncy = 1024 Гц */
extern "C" void timerInterrupt (void)
{
	input[curInputCursor++]=uhADCxConvertedValue; /**< making 1024 points from ADC DMA */
	if (curInputCursor>=1024) 
	{
		curInputCursor = 0;
		dataIsReady = 1; 
		HAL_TIM_Base_DeInit(&htim1); /**< turn off interrupts when all data is ready */
	}
	invertLed(); /**< Checking sampling frequency on osciloscope (1024 Hz it's true) */
}

/** @brief Task with FFT calculation */
static void fftTask (void *p) 
{
	q15_t maxValue;				/* Max FFT value is stored here */
	uint32_t maxIndex;				/* Index in Output array where max value is */

	while(1)
	{
		if (dataIsReady) /**< if data is ready starting calculation */
		{
			dataIsReady = 0;

			arm_cfft_radix2_init_q15 (&fftInstance, 1024, 0, 1);
			arm_cfft_radix2_q15(&fftInstance, input);
			arm_cmplx_mag_q15 (input, output, 1024);
			u32 index;
			saveFft();
			timInit(); /**< run timer again for next 1024 points */
		}
	}
}


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Line 1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fftInstance'
Line 2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'curInputCursor'
Line 3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'dataIsReady'
Line 4: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'input'
Line 5: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'output'
Line 8: error: expected identifier or '(' before string constant
In function 'fftTask':
Line 23: error: 'q15_t' undeclared (first use in this function)
Line 23: error: (Each undeclared identifier is reported only once
Line 23: error: for each function it appears in.)
Line 23: error: expected ';' before 'maxValue'
Line 24: error: 'uint32_t' undeclared (first use in this function)
Line 24: error: expected ';' before 'maxIndex'
Line 28: error: 'dataIsReady' undeclared (first use in this function)
Line 32: error: 'fftInstance' undeclared (first use in this function)
Line 33: error: 'input' undeclared (first use in this function)
Line 34: error: 'output' undeclared (first use in this function)
Line 35: error: 'u32' undeclared (first use in this function)
Line 35: error: expected ';' before 'index'


Create a new paste based on this one


Comments: