<div dir="ltr">I've tried with just a boolean toggle in the interrupt handler and with a call to rtems_gpio_set(BBB_LED_USR3) in order to see led activity and it does the same thing.<div><span style="font-size:12.8px">Sudarshan:</span><br></div><div><span style="font-size:12.8px">Yes, a return statement in an interrupt handler.</span></div><div><span style="font-size:12.8px">This is because this handler is called by the real interrupt handler installed by the driver. The code of the real interrupt handler does this:</span></div><div><span style="font-size:12.8px"><br></span></div><div><div style=""><span style="font-size:12.8px">if ( (isr_node->handler)(isr_node->arg) == IRQ_HANDLED ) {</span></div><div style=""><span style="font-size:12.8px">          ++handled_count;</span></div><div style=""><span style="font-size:12.8px">        }</span></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-11-09 15:41 GMT-03:00 sudarshan.rajagopalan <span dir="ltr"><<a href="mailto:sudarshan.rajagopalan@vecna.com" target="_blank">sudarshan.rajagopalan@vecna.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2015-11-09 13:11, Federico Garcia Cruz wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi everyone,<br>
I'm using the GPIO api for the BBB but I'm having problems with the<br>
interrupt handling.<br>
I'm blinking two leds in the main thread and I have a GPIO input with<br>
an interrupt attached that uses printk to print a message. The problem<br>
is that the interrupt handler prints the message but never returns<br>
(main thread leds stop blinking after that).<br>
Any suggestion?<br>
Here's my code:<br>
<br>
rtems_gpio_irq_state gpio_handler(void* /*arg*/)<br>
{<br>
    printk("interrupt handler\n");<br>
    return IRQ_HANDLED;<br>
}<br>
</blockquote>
<br></span>
A return statement inside an interrupt handler?? Where does it return back to?<br>
<br>
- Sudarshan<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<br>
void* POSIX_Init(void*)<br>
{<br>
    rtems_mode previous_mode_set;<br>
    rtems_task_mode(RTEMS_TIMESLICE | RTEMS_PREEMPT,<br>
RTEMS_TIMESLICE_MASK | RTEMS_PREEMPT_MASK, &previous_mode_set);<br>
    rtems_status_code sc = rtems_gpio_initialize();<br>
    printk("%d\n", sc);<br>
<br>
    sc = rtems_gpio_request_pin(BBB_LED_USR0, DIGITAL_OUTPUT, true,<br>
false, NULL);<br>
    printk("DIGITAL_OUTPUT: %d\n", sc);<br>
    sc = rtems_gpio_request_pin(BBB_LED_USR3, DIGITAL_OUTPUT, true,<br>
false, NULL);<br>
    printk("DIGITAL_OUTPUT: %d\n", sc);<br>
<br>
    sc = rtems_gpio_request_pin(BBB_P8_7, DIGITAL_INPUT, false, false,<br>
NULL);<br>
    printk("DIGITAL_INPUT: %d\n", sc);<br>
<br>
    sc = rtems_gpio_enable_interrupt(BBB_P8_7, FALLING_EDGE,<br>
UNIQUE_HANDLER, false, gpio_handler, NULL);<br>
    printk("interrupt install: %d\n", sc);<br>
<br>
    while(1)<br>
    {<br>
        sleep(1);<br>
        rtems_gpio_clear(BBB_LED_USR3);<br>
        rtems_gpio_set(BBB_LED_USR0);<br>
        sleep(1);<br>
        rtems_gpio_set(BBB_LED_USR3);<br>
        rtems_gpio_clear(BBB_LED_USR0);<br>
    }<br>
    return NULL;<br>
}<br>
<br>
Thanks in advance!--<br>
<br></div></div>
 [1]<span class=""><br>
<br>
Federico Garcia Cruz<br>
<br>
Software Engineer<br>
<br>
San Lorenzo 47, 3rd Floor, Office 5<br>
<br>
Córdoba, Argentina<br>
<br>
Phone: +54 351 4217888 / +54 351 4218211<br>
<br></span>
 [2] [3]<br>
<br>
<br>
Links:<br>
------<br>
[1] <a href="http://www.tallertechnologies.com" rel="noreferrer" target="_blank">http://www.tallertechnologies.com</a><br>
[2] <a href="http://www.linkedin.com/company/taller-technologies" rel="noreferrer" target="_blank">http://www.linkedin.com/company/taller-technologies</a><br>
[3] <a href="https://www.facebook.com/tallertechnologies" rel="noreferrer" target="_blank">https://www.facebook.com/tallertechnologies</a><span class=""><br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</span></blockquote>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><a href="http://www.tallertechnologies.com" style="text-decoration:none" target="_blank"><span style="font-size:16px;font-family:Arial;color:#1155cc;background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:underline;vertical-align:baseline;white-space:pre-wrap"><img src="https://lh6.googleusercontent.com/oWr5yxNDJfjF0N2yhmiSzhU9vstfXfDLCQju49Xj_5frxoG-vk_hKzOt-k3KSsZv5W5cNnZSjNmWi53XYbfiAsytvz44AptjWiDYFTLIhRiRifwjwHtlfPJmhrqmfEub1w" width="200" height="77" style="border:none"></span></a></p><p style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><b style="font-weight:normal"><br></b></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:16px;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Federico Garcia Cruz</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:15px;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Software Engineer</span></p><p style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><b style="font-weight:normal"><br></b></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11px;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">San Lorenzo 47, 3rd Floor, Office 5</span></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11px;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Córdoba, Argentina</span></p><p style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><b style="font-weight:normal"><br></b></p><p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11px;font-family:Arial;color:#000000;background-color:transparent;font-weight:bold;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Phone:</span><span style="font-size:11px;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"> +54 351 4217888 / +54 351 4218211</span></p><p style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><br><a href="http://www.linkedin.com/company/taller-technologies" style="text-decoration:none" target="_blank"><span style="font-size:15px;font-family:Arial;color:rgb(17,85,204);text-decoration:underline;vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><img src="https://lh5.googleusercontent.com/-PNbLrk4FTcGDH9qlK0E9EOXNq30yjxcZdWdV1nrz0nea-2DSHK5Imha-1oItxasCqkHsragWxBQoGaM6htV8ZiSNmtX0zr_6h7l5SAekmvgRly09D1cmbVt4sQ8cKtmIQ" width="20px;" height="20px;" style="border:none"></span></a><a href="https://www.facebook.com/tallertechnologies" style="text-decoration:none" target="_blank"><span style="font-size:15px;font-family:Arial;color:rgb(17,85,204);text-decoration:underline;vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><img src="https://lh6.googleusercontent.com/35gyAmo2veV0QIAK20LuNB8ouSDb62YfPd5NEbXdxvdLdbt8aNQo4c9SSXKUhbi8L69xj0fFH9HgavVbFraoqN04JrxkLfRzwsMLY2nTfDChb5Neflw7ezpE6_LxseIKGw" width="19px;" height="19px;" style="border:none"></span></a><br></p></div></div>
</div>