Mettre à jour 'BE-chti C/soft/PjtKEIL_StepSon/Src/principal.c'
This commit is contained in:
parent
d3dc3d3eeb
commit
7727ffa188
1 changed files with 15 additions and 6 deletions
|
@ -1,7 +1,12 @@
|
||||||
|
|
||||||
|
#include "GestionSon.h"
|
||||||
#include "DriverJeuLaser.h"
|
#include "DriverJeuLaser.h"
|
||||||
|
|
||||||
|
#define TE_IN_TICKS 6552
|
||||||
|
#define PERIODE_PWM 720
|
||||||
|
|
||||||
|
extern short Sortie_son;
|
||||||
|
|
||||||
extern void CallbackSon(void);
|
extern void CallbackSon(void);
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,13 +20,17 @@ int main(void)
|
||||||
// ============= INIT PERIPH (faites qu'une seule fois) =====================
|
// ============= INIT PERIPH (faites qu'une seule fois) =====================
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
// Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers
|
// Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers
|
||||||
CLOCK_Configure();
|
CLOCK_Configure();
|
||||||
|
|
||||||
Timer_1234_Init_ff(TIM4, 65520000);
|
// Timer_1234_Init_ff(TIM4, PeriodeSonMicroSec * US_IN_TICKS);
|
||||||
Active_IT_Debordement_Timer(TIM4, 2, CallbackSon);
|
Timer_1234_Init_ff(TIM4, TE_IN_TICKS);
|
||||||
Run_Timer(TIM4);
|
//Timer_1234_Init_ff(TIM3, PERIODE_PWM); // periode de la PWM = 10us
|
||||||
|
Active_IT_Debordement_Timer(TIM4, 2, GestionSon);
|
||||||
|
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
|
||||||
|
|
||||||
|
PWM_Init_ff(TIM3, 3, PERIODE_PWM);
|
||||||
|
StartSon();
|
||||||
|
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
Loading…
Reference in a new issue