CHTI/soft/PjtKEIL_StepSon/Src/principal.c
Clement Mauperon dbe899586d fin séance
2023-03-21 18:18:30 +01:00

35 lines
752 B
C

#include "DriverJeuLaser.h"
#define CLOCK_FREQ 72000 // kHz
extern int 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();
Timer_1234_Init_ff(TIM4, PeriodeSonMicroSec * CLOCK_FREQ);
GPIO_Configure(GPIOB, 1, OUTPUT, OUTPUT_PPULL);
Active_IT_Debordement_Timer(TIM4, 2, CallbackSon);
//============================================================================
while (1)
{
}
}