chti23SBCZT/soft/PjtKEIL_StepSon/Src/principal.c

31 lines
778 B
C

#include "DriverJeuLaser.h"
extern void callback_son(void);
extern void start_son(void);
int button = 0;
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, 6552);
Active_IT_Debordement_Timer(TIM4, 2, callback_son);
PWM_Init_ff( TIM3, 3, 720);
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
//============================================================================
while (1)
{
if (button == 1){
start_son();
button = 0;
}
}
}