forked from acco/chti23
26 lines
793 B
C
26 lines
793 B
C
#include "DriverJeuLaser.h"
|
|
|
|
extern void CallbackSon(void);
|
|
extern void StartSon(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); // f_PWM = 72MHz/720 = 100kHz
|
|
Timer_1234_Init_ff(TIM4, 6552); // periode_son/f_CPU = (91*10^-6)*(72*10^6) = 6552
|
|
Active_IT_Debordement_Timer(TIM4, 2, CallbackSon);
|
|
|
|
//============================================================================
|
|
while (1)
|
|
{
|
|
StartSon();
|
|
}
|
|
}
|
|
|