12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
-
-
- #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
-
- //** Placez votre code là ** //
-
- //on a la clock a 72 Mhz donc pour avoir 100 ms il nus faut
-
- // 1 sec = 72 . 10^6 donc en
-
- // 7,2 Millions de cycles
-
- //c'est 100 ms
- Timer_1234_Init_ff( TIM1, 7200000);
-
- Active_IT_Debordement_Timer( TIM1, 2, timer_callback );
-
- // 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
-
- //** Placez votre code là ** //
-
-
-
- // configuration de PortB.1 (PB1) en sortie push-pull
- GPIO_Configure(GPIOB, 1, OUTPUT, OUTPUT_PPULL);
-
-
-
-
- //============================================================================
-
-
- while (1)
- {
- }
- }
-
- //char FlagCligno;
-
- //void timer_callback(void)
- //{
- // if (FlagCligno==1)
- // {
- // FlagCligno=0;
- // GPIOB_Set(1);
- // }
- // else
- // {
- // FlagCligno=1;
- // GPIOB_Clear(1);
- // }
- //
- //}
-
|