forked from acco/chti23
46 lines
951 B
C
46 lines
951 B
C
|
|
#include "DriverJeuLaser.h"
|
|
|
|
|
|
//extern u32 * PeriodeSonMicroSec;
|
|
|
|
extern void CallbackSon(void);
|
|
|
|
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();
|
|
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
|
|
PWM_Init_ff( TIM3, 3, 720);
|
|
PWM_Set_Value_TIM3_Ch3(360);
|
|
Timer_1234_Init_ff( TIM4, 91*72); //Calcul de la periode de 91 microsec *72 Mhz
|
|
Active_IT_Debordement_Timer( TIM4, 2, CallbackSon );
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
|
|
while (1)
|
|
{
|
|
}
|
|
}
|
|
|
|
/*
|
|
short int SortieSon
|
|
int index
|
|
Algo CallbackSon
|
|
if index<longueur
|
|
on stocke son[index] dans r0
|
|
mise a l'echelle
|
|
sortieson=a*son[index]+b
|
|
index ++
|
|
}
|
|
|
|
*/
|