2023-03-24 17:46:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "DriverJeuLaser.h"
|
2023-03-24 18:19:45 +01:00
|
|
|
|
# define PERIODE 6552
|
2023-03-27 10:52:01 +02:00
|
|
|
|
# define PERIODE_PWM 720
|
2023-03-24 17:46:09 +01:00
|
|
|
|
|
2023-03-27 10:52:01 +02:00
|
|
|
|
//int modulation(int i);
|
|
|
|
|
//void CallbackSon(void);
|
|
|
|
|
|
|
|
|
|
//extern short int Son [];
|
|
|
|
|
//extern short int LongueurSon;
|
|
|
|
|
|
|
|
|
|
//short int SortieSon;
|
|
|
|
|
extern void CallbackSon(void);
|
2023-03-24 17:46:09 +01:00
|
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// ===========================================================================
|
|
|
|
|
// ============= INIT PERIPH (faites qu'une seule fois) =====================
|
|
|
|
|
// ===========================================================================
|
|
|
|
|
|
|
|
|
|
// Apr<70>s ex<65>cution : le coeur CPU est clock<63> <20> 72MHz ainsi que tous les timers
|
|
|
|
|
CLOCK_Configure();
|
2023-03-24 18:19:45 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Timer_1234_Init_ff(TIM4,PERIODE);
|
|
|
|
|
Active_IT_Debordement_Timer(TIM4, 2, CallbackSon);
|
2023-03-24 17:46:09 +01:00
|
|
|
|
|
2023-03-27 10:52:01 +02:00
|
|
|
|
//Timer_1234_Init_ff(TIM3,PERIODE_PWM);
|
|
|
|
|
|
|
|
|
|
PWM_Init_ff( TIM3, 3, 720);
|
|
|
|
|
|
2023-03-24 17:46:09 +01:00
|
|
|
|
|
2023-03-27 10:52:01 +02:00
|
|
|
|
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
|
2023-03-24 17:46:09 +01:00
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (1)
|
|
|
|
|
{
|
2023-03-27 10:52:01 +02:00
|
|
|
|
//PWM_Set_Value_TIM3_Ch3(SortieSon);
|
2023-03-24 17:46:09 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-27 10:52:01 +02:00
|
|
|
|
//void CallbackSon(void){
|
|
|
|
|
//static int i = 0;
|
|
|
|
|
//if(i < LongueurSon){
|
|
|
|
|
// SortieSon = (Son[i] + 32768) * 719 / 65535;
|
|
|
|
|
// i++;
|
|
|
|
|
// }
|
2023-03-24 18:19:45 +01:00
|
|
|
|
|