46 lines
1,009 B
C
46 lines
1,009 B
C
|
|
|
|
#include "DriverJeuLaser.h"
|
|
|
|
void timer_callback(void);
|
|
|
|
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();
|
|
|
|
// configuration du Timer 4 en débordement 100ms
|
|
|
|
Timer_1234_Init_ff(TIM4, 7200000);
|
|
|
|
|
|
// Activation des interruptions issues du Timer 4
|
|
// Association de la fonction à exécuter lors de l'interruption : timer_callback
|
|
// cette fonction (si écrite en ASM) doit être conforme à l'AAPCS
|
|
|
|
Active_IT_Debordement_Timer(TIM4, 2, timer_callback);
|
|
//** Placez votre code là ** //
|
|
|
|
|
|
|
|
// configuration de PortB.1 (PB1) en sortie push-pull
|
|
GPIO_Configure(GPIOB, 1, OUTPUT, OUTPUT_PPULL);
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
|
|
while (1)
|
|
{
|
|
}
|
|
}
|
|
|
|
|
|
|