36 lines
905 B
C
Executable file
36 lines
905 B
C
Executable file
|
||
|
||
#include "DriverJeuLaser.h"
|
||
#include "GestionSon.h"
|
||
|
||
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);
|
||
|
||
// On calcul la période : 0,000091 / (1 / 72M) = 6 552
|
||
Timer_1234_Init_ff(TIM4, 6552);
|
||
|
||
// Comment mettre cette fonction dans un code ASM ??
|
||
Active_IT_Debordement_Timer( TIM4, 2, CallbackSon);
|
||
|
||
PWM_Init_ff( TIM3, 3, 720);
|
||
//PWM_Set_Value_TIM3_Ch3(360);
|
||
|
||
|
||
|
||
|
||
//============================================================================
|
||
for (int i = 0; i < 5000000; ++i){;}
|
||
StartSon();
|
||
while (1)
|
||
{
|
||
}
|
||
}
|
||
|