CHti23/BE-chti C/soft/PjtKEIL_StepSon/Src/principal.c
2023-05-16 00:44:57 +02:00

44 lines
No EOL
1.1 KiB
C

#include "DriverJeuLaser.h"
#include "GestionSon.h"
// #define US_IN_TICKS 72
#define TE 6552
#define PERIODE_PWM 720
// extern long PeriodeSonMicroSec;
extern void CallbackSon(void);
extern short SortieSon;
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 * US_IN_TICKS);
Timer_1234_Init_ff(TIM4, TE);
//Timer_1234_Init_ff(TIM3, PERIODE_PWM); // periode de la PWM = 10us , frequence = 100kHz
Active_IT_Debordement_Timer(TIM4, 2, CallbackSon);
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
PWM_Init_ff(TIM3, 3, PERIODE_PWM);
//StarSon();
// Son_index = &Son;
// GPIOB_Set(0);
//============================================================================
while (1)
{
}
}