grpE_REES_KOUTSODIMA/soft/PjtKEIL_StepSon/Src/principal.c
2023-04-19 11:29:35 +02:00

53 lines
1 KiB
C

#include "DriverJeuLaser.h"
//extern u32 * PeriodeSonMicroSec;
extern void CallbackSon(void);
extern void StartSon(void);
int bouton=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();
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
PWM_Init_ff( TIM3, 3, 720);
PWM_Set_Value_TIM3_Ch3(360);
Timer_1234_Init_ff( TIM4, 91*72); //Calcul de la periode de 91 microsec *72 Mhz
Active_IT_Debordement_Timer( TIM4, 2, CallbackSon );
//============================================================================
while (1)
{
if (bouton==1) {
StartSon();
bouton=0;
}
}
}
/*
short int SortieSon
int index
Algo CallbackSon
if index<longueur
on stocke son[index] dans r0
mise a l'echelle
sortieson=a*son[index]+b
index ++
}
*/