BE-CHTI-2020.2021/PjtKEIL_StepSon/Src/principal.c
Barbanson Adrien 4d361e1f24 first commit
2021-04-04 17:38:36 +02:00

38 lines
790 B
C
Executable file

#include "DriverJeuLaser.h"
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();
int nbCycles = PeriodeSonMicroSec * 72; //PeriodeSonMicroSec * 0.000001 * 72 000 000
Timer_1234_Init_ff( TIM4, nbCycles);
Active_IT_Debordement_Timer( TIM4, 2, CallBackSon );
//============================================================================
while (1)
{
}
}