forked from acco/chti23
61 lines
1.4 KiB
C
61 lines
1.4 KiB
C
#include "DriverJeuLaser.h"
|
||
#include "../Driver/Affichage_Valise.h"
|
||
|
||
|
||
extern int DFTReel(short int *Signal, int k);
|
||
extern int DFTImage(short int *Signal, int k);
|
||
extern int DFTTotale(short int *Signal, int k);
|
||
|
||
extern short int LeSignal[];
|
||
int tabDFT[64];
|
||
int i;
|
||
|
||
short int buffer_dma[64];
|
||
|
||
void * Systick_callback(){
|
||
Start_DMA1(64);
|
||
Wait_On_End_Of_DMA1();
|
||
Stop_DMA1;
|
||
for(i = 0;i<64;i++){
|
||
tabDFT[i] = DFTTotale(&(buffer_dma[0]), i);
|
||
}
|
||
}
|
||
|
||
int main(void)
|
||
{
|
||
|
||
// ===========================================================================
|
||
// ============= INIT PERIPH (faites qu'une seule fois) =====================
|
||
// ===========================================================================
|
||
|
||
// Apr<70>s ex<65>cution : le coeur CPU est clock<63> <20> 72MHz ainsi que tous les timers
|
||
CLOCK_Configure();
|
||
|
||
//Config SysTick/DMA
|
||
Systick_Period_ff(360000);
|
||
Systick_Prio_IT( 0, Systick_callback);
|
||
SysTick_On ;
|
||
SysTick_Enable_IT ;
|
||
|
||
//Config TIM2/ADC
|
||
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, buffer_dma );
|
||
|
||
|
||
|
||
|
||
|
||
//============================================================================
|
||
|
||
while (1)
|
||
{
|
||
/*for(i = 0;i<64;i++){
|
||
//tabDFT[0] = DFTReel(&(LeSignal[0]), 0);
|
||
tabDFT[i] = DFTTotale(&(buffer_dma[0]), i);
|
||
//tabDFT[2] = DFTReel(&(LeSignal[0]), 2);
|
||
}*/
|
||
}
|
||
}
|
||
|