introduction du StarSon et timer3
This commit is contained in:
parent
699c16188d
commit
e243030bba
1 changed files with 19 additions and 24 deletions
|
@ -1,15 +1,16 @@
|
||||||
#include "DriverJeuLaser.h"
|
#include "DriverJeuLaser.h"
|
||||||
# define PERIODE 6552
|
#include "GestionSon.h"
|
||||||
|
|
||||||
|
// #define US_IN_TICKS 72
|
||||||
|
#define TE 6552
|
||||||
#define PERIODE_PWM 720
|
#define PERIODE_PWM 720
|
||||||
|
|
||||||
//int modulation(int i);
|
// extern long PeriodeSonMicroSec;
|
||||||
//void CallbackSon(void);
|
|
||||||
|
|
||||||
//extern short int Son [];
|
|
||||||
//extern short int LongueurSon;
|
|
||||||
|
|
||||||
//short int SortieSon;
|
|
||||||
extern void CallbackSon(void);
|
extern void CallbackSon(void);
|
||||||
|
extern short SortieSon;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
@ -21,29 +22,23 @@ int main(void)
|
||||||
// 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, PeriodeSonMicroSec * US_IN_TICKS);
|
||||||
Timer_1234_Init_ff(TIM4,PERIODE);
|
Timer_1234_Init_ff(TIM4, TE);
|
||||||
|
//Timer_1234_Init_ff(TIM3, PERIODE_PWM); // periode de la PWM = 10us , frequence = 100kHz
|
||||||
Active_IT_Debordement_Timer(TIM4, 2, CallbackSon);
|
Active_IT_Debordement_Timer(TIM4, 2, CallbackSon);
|
||||||
|
|
||||||
//Timer_1234_Init_ff(TIM3,PERIODE_PWM);
|
|
||||||
|
|
||||||
PWM_Init_ff( TIM3, 3, 720);
|
|
||||||
|
|
||||||
|
|
||||||
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
|
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
|
||||||
|
PWM_Init_ff(TIM3, 3, PERIODE_PWM);
|
||||||
|
|
||||||
|
//StarSon();
|
||||||
|
// Son_index = &Son;
|
||||||
|
// GPIOB_Set(0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
//PWM_Set_Value_TIM3_Ch3(SortieSon);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//void CallbackSon(void){
|
|
||||||
//static int i = 0;
|
|
||||||
//if(i < LongueurSon){
|
|
||||||
// SortieSon = (Son[i] + 32768) * 719 / 65535;
|
|
||||||
// i++;
|
|
||||||
// }
|
|
Loading…
Reference in a new issue