Skip to content

Instantly share code, notes, and snippets.

@SaheblalBagwan
Last active April 13, 2016 15:15
Show Gist options
  • Save SaheblalBagwan/ee07ec3913b23f580a651c5f33dcd3af to your computer and use it in GitHub Desktop.
Save SaheblalBagwan/ee07ec3913b23f580a651c5f33dcd3af to your computer and use it in GitHub Desktop.
#include <lpc17xx.h>
#include "stdutils.h"
#include "gpio.h"
#include "extintr.h"
#define LED1 P2_0
#define LED2 P2_1
void myExtIntrIsr_0(void)
{
GPIO_PinToggle(LED1); /* Toggle the LED1 (P2_0) */
}
void myExtIntrIsr_1(void)
{
GPIO_PinToggle(LED2); /* Toggle the LED2 (P2_1) */
}
int main (void)
{
SystemInit();
GPIO_PinDirection(LED1,OUTPUT); /* Configure the pins as Output to blink the Leds*/
GPIO_PinDirection(LED2,OUTPUT);
EINT_AttachInterrupt(EINT0,myExtIntrIsr_0,FALLING); /* myExtIntrIsr_0 will be called by EINT0_IRQHandler */
EINT_AttachInterrupt(EINT1,myExtIntrIsr_1,FALLING); /* myExtIntrIsr_1 will be called by EINT1_IRQHandler */
while(1)
{
//do nothing
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment