Increment a counter in interupt and print it in background
Sent from Yahoo Mail on Android
On Mon, May 8, 2017 at 5:08 AM, [email protected]<[email protected]> wrote:
hey everyone,
i hope i post in the right place but if not, please inform me to post it in a
more suitable place...
Let me describe my problem..
For my project, i use starterware (version 2.00.01.01) and build my files via
code composer studio (version 6.1.0.00104) with compiler version:GNU v4.8.4
(Linaro).
My goal is to learn using interrupts. Thus i started with a simple project in
mind: by pressing a switch i expect to create an interrupt in an input pin of
my beaglebone and via the isr i created, i want to turn off a led that was
already on and turn on an other, previously off, led.
The problem seems to be that i can not get an interrupt...
I give you the piece of code responsible for achieving my goal:
IntMasterIRQEnable();IntAINTCInit();GPIO1ModuleClkConfig();GpioModuleEnable(SOC_GPIO_1_REGS);GPIODirModeSet(SOC_GPIO_1_REGS,
GPIO_INTER_INP, GPIO_DIR_INPUT);IntRegister(SYS_INT_GPIOINT1A,
isr_buttonLed);IntPrioritySet(SYS_INT_GPIOINT1A, 0,
AINTC_HOSTINT_ROUTE_IRQ);IntSystemEnable(SYS_INT_GPIOINT1A);GPIOIntTypeSet(SOC_GPIO_1_REGS,GPIO_INTER_INP,GPIO_INT_TYPE_LEVEL_HIGH);HWREG(SOC_GPIO_1_REGS
+ 0x34) = 0x10;HWREG(SOC_GPIO_1_REGS + 0x38) = 0x10;HWREG(SOC_GPIO_1_REGS +
0x44) = 0x10;
////------isr function
//
static void isr_buttonLed(void){ /* Clear interrupt */
HWREG(SOC_GPIO_1_REGS + 0x2C) = 0x10; HWREG(SOC_GPIO_1_REGS + 0x30) = 0x10;
//turn off led that is already on GPIOPinWrite(SOC_GPIO_1_REGS, GPIO_LED_ON,
GPIO_PIN_LOW); //turn on an other led GPIOPinWrite(SOC_GPIO_1_REGS,
GPIO_LED_2, GPIO_PIN_HIGH); //again enable IRQ HWREG(SOC_GPIO_1_REGS + 0x34)
= 0x10;//GPIO_IRQSTATUS_SET_0 HWREG(SOC_GPIO_1_REGS + 0x38) =
0x10;//GPIO_IRQSTATUS_SET_1
HWREG(SOC_GPIO_1_REGS + 0x44) = 0x10;//GPIO_IRQWAKEN_0
}
Unfortunately, nothing happens when i push the switch..can somebody point out
to me a possible solution or what is wrong with the above?
Moreover, how can i test if an interrupt is actually triggered or not when i
push the switch?
Thanks in advance for any help
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/faa84f8d-fc8c-4e27-adea-8f6a2157de3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/1643224468.1544374.1494240525099%40mail.yahoo.com.
For more options, visit https://groups.google.com/d/optout.