Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. int main (void)
  2. {
  3. SystemInit();
  4.  
  5. GPIO_PinDirection(LED1,OUTPUT); /* Configure the pins as Output to blink the Leds*/
  6. GPIO_PinDirection(LED2,OUTPUT);
  7.  
  8. TIMER_Init(0,100000); /* Configure timer0 to generate 100ms(100000us) delay*/
  9. TIMER_Init(1,500000); /* Configure timer1 to generate 500ms(500000us) delay*/
  10.  
  11. TIMER_AttachInterrupt(0,myTimerIsr_0); /* myTimerIsr_0 will be called by TIMER0_IRQn */
  12. TIMER_AttachInterrupt(1,myTimerIsr_1); /* myTimerIsr_1 will be called by TIMER1_IRQn */
  13.  
  14. TIMER_Start(0); /* Start the Timers */
  15. TIMER_Start(1);
  16.  
  17. while(1)
  18. {
  19. //do nothing
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement