diff --git a/soft/PjtKEIL_StepDeb_2/Src/principal.c b/soft/PjtKEIL_StepDeb_2/Src/principal.c index 1cb26f6..f0f9d9f 100644 --- a/soft/PjtKEIL_StepDeb_2/Src/principal.c +++ b/soft/PjtKEIL_StepDeb_2/Src/principal.c @@ -12,21 +12,21 @@ 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 +// 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 +// configuration du Timer 4 en débordement 100ms -//** Placez votre code là ** // +//** Placez votre code là ** // 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 +// Association de la fonction à exécuter lors de l'interruption : timer_callback +// cette fonction (si écrite en ASM) doit être conforme à l'AAPCS -//** Placez votre code là ** // +//** Placez votre code là ** // Active_IT_Debordement_Timer(TIM4, 2, timer_callback); @@ -45,3 +45,19 @@ while (1) } +char FlagCligno; + +void timer_callback(void) +{ + if (FlagCligno==1) + { + FlagCligno=0; + GPIOB_Set(1); + } + else + { + FlagCligno=1; + GPIOB_Clear(1); + } + +} \ No newline at end of file