forked from acco/chti23
40 lines
969 B
C
40 lines
969 B
C
|
|
|
|
#include "DriverJeuLaser.h"
|
|
|
|
extern void CallbackSon(void);
|
|
extern short SortieSon ;
|
|
extern void StartSon(void) ;
|
|
extern short Index ;
|
|
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();
|
|
|
|
Timer_1234_Init_ff( TIM4, 6552);
|
|
//Timer_1234_Init_ff( TIM3,720);
|
|
|
|
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
|
|
PWM_Init_ff( TIM3, 3, 720);
|
|
Active_IT_Debordement_Timer( TIM4, 2, CallbackSon);
|
|
|
|
//============================================================================
|
|
|
|
//Pour la prochaine fois, on doit afficher le signal sur l'oscillo et coder la fonction start
|
|
|
|
while (1)
|
|
{
|
|
|
|
if (Index==-1){
|
|
StartSon() ;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|