<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic @George in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Edison-Interrupt-Service-Routine/m-p/1035377#M43698</link>
    <description>&lt;P&gt;@George&lt;/P&gt;

&lt;P&gt;would you mind copy&amp;amp;pasting this feature request to&amp;nbsp;https://communities.intel.com/community/makers/? The forum &amp;nbsp;you posted here is mostly around&amp;nbsp;&lt;SPAN style="line-height: 19.5120010375977px; font-size: 1em;"&gt;Intel IoT developer kit&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp; but not about Arduino IDE which isn't part of the devkit. &lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;On questions on how to bring it to C/C++/Python or Node.JS using the devkit feel free to continue on this forum.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Dec 2014 14:59:57 GMT</pubDate>
    <dc:creator>Matthias_H_Intel</dc:creator>
    <dc:date>2014-12-02T14:59:57Z</dc:date>
    <item>
      <title>Edison Interrupt Service Routine</title>
      <link>https://community.intel.com/t5/Software-Archive/Edison-Interrupt-Service-Routine/m-p/1035373#M43694</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;are there any example for implement a interrupt service Routine??&lt;/P&gt;</description>
      <pubDate>Sat, 25 Oct 2014 20:18:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Edison-Interrupt-Service-Routine/m-p/1035373#M43694</guid>
      <dc:creator>BDahl2</dc:creator>
      <dc:date>2014-10-25T20:18:35Z</dc:date>
    </item>
    <item>
      <title>with C using libmraa:</title>
      <link>https://community.intel.com/t5/Software-Archive/Edison-Interrupt-Service-Routine/m-p/1035374#M43695</link>
      <description>&lt;P&gt;with C using libmraa:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://github.com/intel-iot-devkit/mraa/blob/master/examples/isr_pin6.c" target="_blank"&gt;https://github.com/intel-iot-devkit/mraa/blob/master/examples/isr_pin6.c&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;with python using mraa:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://github.com/intel-iot-devkit/mraa/blob/master/examples/python/hello_isr.py" target="_blank"&gt;https://github.com/intel-iot-devkit/mraa/blob/master/examples/python/hello_isr.py&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2014 10:38:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Edison-Interrupt-Service-Routine/m-p/1035374#M43695</guid>
      <dc:creator>Brendan_L_Intel</dc:creator>
      <dc:date>2014-10-29T10:38:52Z</dc:date>
    </item>
    <item>
      <title>Hi, </title>
      <link>https://community.intel.com/t5/Software-Archive/Edison-Interrupt-Service-Routine/m-p/1035375#M43696</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Hi,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;the example is nice, but it does not tell you how to safely manage resources, that you feed into the interrupt function via the void* args parameter. If you only use static resources, everything will be fine. But if you use dynamically allocated resources in your interrupt function, there is no safe way to deallocate the resource, since you don't know if the interrupt function is still using the resource.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;By calling mraa_gpio_close will not cancel the interrupt handling thread. By doing this, the gpio file will be closed and the interrupt handler thread will terminate the next time it tries to poll the interrupts. When this will happen, depends on your interrupt function. If you deallocate your resources immediately after calling mraa_gpio_close, the interrupt function may still use the deallocated memory.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;But there is another option. You can call mraa_gpio_isr_exit, which tries to cancel the thread immediately. The problem is that this function also does not guarantee that the thread is canceled after the call. If your interrupt function is being executed, the thread will continue to run until your function exits, because thread cancellation is disabled as long as the interrupt function is being executed. So you can not safely deallocate your resources after calling mraa_gpio_isr_exit.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Currently you will have to wait some time after mraa_gpio_close or mraa_gpio_isr_exit and hope that your interrupt function will be finished after the given time span.&lt;/P&gt;

&lt;P&gt;Best regards,&lt;/P&gt;

&lt;P&gt;Bernd&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2014 11:43:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Edison-Interrupt-Service-Routine/m-p/1035375#M43696</guid>
      <dc:creator>Bernd_B_</dc:creator>
      <dc:date>2014-10-29T11:43:44Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Software-Archive/Edison-Interrupt-Service-Routine/m-p/1035376#M43697</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm new to Intel Edison development and just a bit of prior Arduino knowledge behind so please bare with me :)&lt;BR /&gt;
	I am trying to port some Arduino code and an implementation of the DMX protocol, but I think I need to&amp;nbsp;&lt;BR /&gt;
	find equivalent Quark calls for the existing AVR code.&lt;/P&gt;

&lt;P&gt;Here are the functions/constants I will need to replicate on Intel Edison:&lt;/P&gt;

&lt;OL&gt;
	&lt;LI&gt;_SFR_IO_ADDR()&lt;/LI&gt;
	&lt;LI&gt;_SFR_IO8()&lt;/LI&gt;
	&lt;LI&gt;cli() / noInterrupts()&lt;/LI&gt;
	&lt;LI&gt;sei() / interrupts()&lt;/LI&gt;
	&lt;LI&gt;digitalPinToBitMask()&lt;/LI&gt;
	&lt;LI&gt;NOT_A_PORT /&amp;nbsp;PORTB /&amp;nbsp;PORTC /&amp;nbsp;PORTD&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;From what I understand in this post, interrupts()/noInterrupts() can be achieved with libmraa.&lt;BR /&gt;
	Would I use that in plain c on the linux side or from the Arduino IDE ?&lt;/P&gt;

&lt;P&gt;I found&amp;nbsp;&lt;SPAN style="line-height: 19.5120010375977px;"&gt;digitalPinToBitMask() in hardware/arduino/edison/cores/arduino/wiring_digital.h but I get an error when I try to use it:&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;C:\Users\HM\Downloads\Windows\arduino-windows-patched-1.0.4\arduino-windows-1.0.4\arduino-1.5.3-Intel.1.0.4\hardware\arduino\edison\cores\arduino/wiring_digital.h:106:56: error: 'PinDescription' has no member named 'ulPin'
 #define digitalPinToBitMask(P)  ( g_APinDescription&lt;P&gt;.ulPin )&lt;/P&gt;&lt;/PRE&gt;

&lt;P&gt;I've also found this GPIO reference I'm going through at the moment:&lt;BR /&gt;
	&lt;A href="http://www.emutexlabs.com/project/215-intel-edison-gpio-pin-multiplexing-guide" target="_blank"&gt;http://www.emutexlabs.com/project/215-intel-edison-gpio-pin-multiplexing-guide&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Is it feasible to port the DMX code to the IntelEdison ? Where could I find the AVR equivalent calls/constants for Edison ?&lt;/P&gt;

&lt;P&gt;Thank you,&lt;BR /&gt;
	George&lt;/P&gt;</description>
      <pubDate>Tue, 02 Dec 2014 13:38:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Edison-Interrupt-Service-Routine/m-p/1035376#M43697</guid>
      <dc:creator>GProf</dc:creator>
      <dc:date>2014-12-02T13:38:24Z</dc:date>
    </item>
    <item>
      <title>@George</title>
      <link>https://community.intel.com/t5/Software-Archive/Edison-Interrupt-Service-Routine/m-p/1035377#M43698</link>
      <description>&lt;P&gt;@George&lt;/P&gt;

&lt;P&gt;would you mind copy&amp;amp;pasting this feature request to&amp;nbsp;https://communities.intel.com/community/makers/? The forum &amp;nbsp;you posted here is mostly around&amp;nbsp;&lt;SPAN style="line-height: 19.5120010375977px; font-size: 1em;"&gt;Intel IoT developer kit&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp; but not about Arduino IDE which isn't part of the devkit. &lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;On questions on how to bring it to C/C++/Python or Node.JS using the devkit feel free to continue on this forum.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Dec 2014 14:59:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Edison-Interrupt-Service-Routine/m-p/1035377#M43698</guid>
      <dc:creator>Matthias_H_Intel</dc:creator>
      <dc:date>2014-12-02T14:59:57Z</dc:date>
    </item>
    <item>
      <title>Hi Mattias, </title>
      <link>https://community.intel.com/t5/Software-Archive/Edison-Interrupt-Service-Routine/m-p/1035378#M43699</link>
      <description>&lt;P&gt;Hi Mattias,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thank you for the advice. I will ask on the Makers community as well.&lt;BR /&gt;
	If I can get the code running in Arduino that would be great,&lt;BR /&gt;
	but I'm not excluding porting the code to c or python using libmraa&lt;BR /&gt;
	in which case the questions on finding equivalents for the AVR&amp;nbsp;&lt;BR /&gt;
	constants and functions within libmraa remain.&lt;/P&gt;

&lt;P&gt;Would you consider it's possible to do this sort of port manipulation with libmraa ?&lt;BR /&gt;
	If so, how can I continue ?&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
	George&lt;/P&gt;</description>
      <pubDate>Tue, 02 Dec 2014 19:16:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Edison-Interrupt-Service-Routine/m-p/1035378#M43699</guid>
      <dc:creator>GProf</dc:creator>
      <dc:date>2014-12-02T19:16:34Z</dc:date>
    </item>
  </channel>
</rss>

