#include "DriverJeuLaser.h" #define M 64 #define SIZETABK 4 #define SEUIL 0x3c2e1 extern int DFT_ModuleAuCarre( short int * Signal64ech, char k); short int dma_buf[64]; int ReDFT[SIZETABK]; int score[SIZETABK]; int count[SIZETABK]={0}; void init_score(){ for(int i=0;i=SEUIL){ count[k]=(count[k]+1); if(count[k]==15){ score[k]++; count[k]=0; } } else { count[k]=0; } } } int main(void) { // =========================================================================== // ============= INIT PERIPH (faites qu'une seule fois) ===================== // =========================================================================== // Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers CLOCK_Configure(); //Partie Son unsigned int tick=91*72; init_score(); Systick_Period_ff( 5000*72 ); Systick_Prio_IT( 1, ItSystick ); SysTick_On; SysTick_Enable_IT; //timer tous les 100ms pour score 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 ); //============================================================================ while (1) { } }