Web edits
[beagleboard.org.git] / db / 2781.xml
blobf39b36c3cf254ddbf3dc874500927ef6be852998
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <?xml-stylesheet type="text/xsl" href="helma.xsl"?>
3 <xmlroot xmlns:hop="http://www.helma.org/docs/guide/features/database">
4   <hopobject id="2781" name="detachInterrupt" prototype="Page" created="1371825459626" lastModified="1371825474238">
5   <hop:parent idref="2471" prototyperef="Page"/>
6     <is_xhtml type="boolean">true</is_xhtml>
7     <http_remotehost>127.0.0.1</http_remotehost>
8     <http_language>en-US,en;q=0.8</http_language>
9     <uri>detachInterrupt</uri>
10     <http_browser>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36</http_browser>
11     <time type="date">21.06.2013 09:37:54 CDT</time>
12     <hopsession>127.0.0.192.94.94.z5cudt01kfu3</hopsession>
13     <body>&lt;script src=&quot;/static/bonescript-demo.js&quot;&gt;&lt;/script&gt;\r
14 &lt;h2&gt;BoneScript&lt;/h2&gt;\r
16     &lt;div id=&apos;side-menu&apos; class=&quot;t3_sidebar&quot;&gt;\r
17      &lt;ul class=&quot;left-menu&quot;&gt;\r
18       &lt;strong&gt;Navigation&lt;/strong&gt;\r
19       &lt;li&gt;&lt;a href=&quot;/Support/BoneScript/menu/&quot;&gt;Menu contents&lt;/a&gt;&lt;/li&gt;\r
20      &lt;/ul&gt;\r
21     &lt;/div&gt;\r
22     &lt;div class=&quot;t3_content_1&quot;&gt;\r
23      &lt;div id=&apos;connect-status&apos;&gt;&lt;/div&gt;\r
24      &lt;div id=&quot;content_child&quot;&gt;\r
25      &lt;!--- START CONTENT --&gt;\r
27 &lt;h1&gt;detachInterrupt(pin, [callback])&lt;/h1&gt;\r
28 &lt;p&gt;Remove an interrupt handler&lt;/p&gt;\r
29 &lt;p&gt;&lt;i&gt;&lt;em&gt;Note:&lt;/em&gt; This function is still undergoing development and debug.&lt;/i&gt;&lt;/p&gt;\r
30 &lt;h2&gt;Arguments&lt;/h2&gt;\r
31 &lt;ul&gt;\r
32  &lt;li&gt;&lt;em&gt;pin&lt;/em&gt;: the &lt;a href=&quot;/Support/BoneScript/#pin&quot;&gt;BeagleBone\r
33   pin&lt;/a&gt; identifier&lt;/li&gt;\r
34  &lt;li&gt;&lt;em&gt;callback&lt;/em&gt;: called upon completion&lt;/li&gt;\r
35 &lt;/ul&gt;\r
36 &lt;h2&gt;Return value&lt;/h2&gt;\r
37 &lt;ul&gt;\r
38  &lt;li&gt;&lt;a href=&quot;/Support/BoneScript/#true&quot;&gt;true&lt;/a&gt; if successful&lt;/li&gt;\r
39  &lt;li&gt;&lt;a href=&quot;/Support/BoneScript/#false&quot;&gt;false&lt;/a&gt; on failure&lt;/li&gt;\r
40 &lt;/ul&gt;\r
41 &lt;h2&gt;callback(x)&lt;/h2&gt;\r
42 &lt;ul&gt;\r
43  &lt;li&gt;&lt;em&gt;x.err&lt;/em&gt;: error status message&lt;/li&gt;\r
44 &lt;/ul&gt;\r
45 &lt;h2&gt;Example\r
46  &lt;button class=&quot;dynlink&quot; onclick=&quot;demoRun(&apos;code&apos;)&quot;&gt;run&lt;/button&gt;\r
47  &lt;button class=&quot;dynlink&quot; onclick=&quot;demoRestore(&apos;code&apos;)&quot;&gt;restore&lt;/button&gt;\r
48 &lt;/h2&gt;\r
49 &lt;pre id=&quot;code&quot; class=&quot;use-editor&quot; style=&quot;height: 280px;&quot;&gt;\r
50 var b = require(&apos;bonescript&apos;);\r
51 var inputPin = &apos;P8_19&apos;;\r
52 b.pinMode(inputPin, b.INPUT);\r
53 b.attachInterrupt(inputPin, true, b.CHANGE, interruptCallback);\r
54 setTimeout(detach, 1000);\r
56 function interruptCallback(x) {\r
57     console.log(JSON.stringify(x));\r
58 }\r
60 function detach() {\r
61     b.detachInterrupt(inputPin);\r
62     console.log(&apos;Interrupt detached&apos;);\r
63 }&lt;/pre&gt;\r
64 &lt;div readonly id=&apos;console-output&apos; style=&apos;height: 280px;&apos;&gt;&lt;/div&gt;\r
65 &lt;!--\r
66 &lt;h2&gt;Build and execute instructions&lt;/h2&gt;\r
67 &lt;ul&gt;\r
68 &lt;/ul&gt;\r
69 --&gt;\r
70 &lt;h2&gt;See also&lt;/h2&gt;\r
71 &lt;h3&gt;Topics&lt;/h3&gt;\r
72 &lt;ul&gt;\r
73  &lt;li&gt;&lt;a href=&quot;/Support/bone101/#headers&quot;&gt;BeagleBone expansion headers&lt;/a&gt;&lt;/li&gt;\r
74  &lt;li&gt;&lt;a href=&quot;/Support/BoneScript/#digitalio&quot;&gt;Digital I/O&lt;/a&gt;&lt;/li&gt;\r
75 &lt;/ul&gt;\r
76 &lt;h3&gt;Related functions&lt;/h3&gt;\r
77 &lt;ul&gt;\r
78  &lt;li&gt;&lt;a href=&quot;/Support/BoneScript/#require&quot;&gt;require&lt;/a&gt;&lt;/li&gt;\r
79  &lt;li&gt;&lt;a href=&quot;/Support/BoneScript/pinMode/&quot;&gt;pinMode&lt;/a&gt;&lt;/li&gt;\r
80  &lt;li&gt;&lt;a href=&quot;/Support/BoneScript/attachInterrupt/&quot;&gt;attachInterrupt&lt;/a&gt;&lt;/li&gt;\r
81 &lt;/ul&gt;\r
82 &lt;h3&gt;Examples&lt;/h3&gt;\r
83 &lt;ul&gt;\r
84  &lt;li&gt;&lt;a href=&quot;/Support/BoneScript/cape_bacon/&quot;&gt;Bacon Cape&lt;/a&gt;&lt;/li&gt;\r
85 &lt;/ul&gt;\r
87      &lt;!--- START FOOTER --&gt;\r
88      &lt;/div&gt;\r
89     &lt;/div&gt;\r
90     &lt;div style=&quot;clear:both;&quot;&gt;&lt;/div&gt;</body>
91     <pseudoparent idref="2471" prototyperef="Page"/>
92     <http_referer>http://beagleboard.org/support/BoneScript/detachInterrupt/edit</http_referer>
93     <http_host>beagleboard.org</http_host>
94     <lang>en-us</lang>
95     <user>blog.hangerhead.com</user>
96   </hopobject>
97 </xmlroot>