be_chti/PjtKEIL_StepSon/Src/principal.c
2021-08-22 13:23:14 +02:00

36 lines
905 B
C
Executable file
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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)
{
}
}