chti23_Tom_Nathan/soft/PjtKEIL_StepSon/Src/principal.c

44 lines
1 KiB
C

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