forked from acco/chti23
72 lines
1.3 KiB
C
72 lines
1.3 KiB
C
|
|
|
|
#include "DriverJeuLaser.h"
|
|
#include <stdio.h>
|
|
|
|
extern int DFT_ModuleAuCarre(short int* Signal64ech, char k);
|
|
extern short int LeSignal[];
|
|
//int result;
|
|
|
|
int dft[64];
|
|
short int dma_buf[64];
|
|
|
|
void callback() {
|
|
Start_DMA1(64);
|
|
Wait_On_End_Of_DMA1();
|
|
//int somme=0;
|
|
|
|
for (int i=1;i<64;i++) {
|
|
dft[i] = DFT_ModuleAuCarre(&(dma_buf[0]),i);
|
|
//somme+=dft[i];
|
|
}
|
|
|
|
|
|
|
|
Stop_DMA1;
|
|
}
|
|
|
|
int main(void)
|
|
{
|
|
|
|
// ===========================================================================
|
|
// ============= INIT PERIPH (faites qu'une seule fois) =====================
|
|
// ===========================================================================
|
|
|
|
|
|
//int result = DFT_ModuleAuCarre(&(LeSignal[0]),1);
|
|
|
|
//printf("le résultat : %d \n", result);
|
|
|
|
// Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers
|
|
CLOCK_Configure();
|
|
|
|
|
|
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
|
|
|
|
PWM_Init_ff(TIM2,3,720);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Init_TimingADC_ActiveADC_ff(ADC1,72);
|
|
Single_Channel_ADC( ADC1, 2 );
|
|
Init_Conversion_On_Trig_Timer_ff( ADC1, TIM2_CC2, 225 );
|
|
Init_ADC1_DMA1( 0, &(dma_buf[0]) );
|
|
|
|
Systick_Period_ff(5*72*1000);
|
|
Systick_Prio_IT(0,callback);
|
|
SysTick_Enable_IT;
|
|
SysTick_On;
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
while (1)
|
|
{
|
|
}
|
|
}
|
|
|