<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hant-TW">
	<id>https://tommy0804.ddns.net/index.php?action=history&amp;feed=atom&amp;title=Application_-_Monitor_GPIO_interrupt_in_userspace</id>
	<title>Application - Monitor GPIO interrupt in userspace - 修訂紀錄</title>
	<link rel="self" type="application/atom+xml" href="https://tommy0804.ddns.net/index.php?action=history&amp;feed=atom&amp;title=Application_-_Monitor_GPIO_interrupt_in_userspace"/>
	<link rel="alternate" type="text/html" href="https://tommy0804.ddns.net/index.php?title=Application_-_Monitor_GPIO_interrupt_in_userspace&amp;action=history"/>
	<updated>2026-08-21T17:25:25Z</updated>
	<subtitle>本wiki上此頁面的修訂紀錄</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://tommy0804.ddns.net/index.php?title=Application_-_Monitor_GPIO_interrupt_in_userspace&amp;diff=517&amp;oldid=prev</id>
		<title>Tommy：​Refactor: add Category:Projects</title>
		<link rel="alternate" type="text/html" href="https://tommy0804.ddns.net/index.php?title=Application_-_Monitor_GPIO_interrupt_in_userspace&amp;diff=517&amp;oldid=prev"/>
		<updated>2026-08-21T05:17:41Z</updated>

		<summary type="html">&lt;p&gt;Refactor: add [[Category:Projects]]&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hant-TW&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上個修訂&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年8月21日 (五) 13:17的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l37&quot;&gt;第37行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第37行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         g++ watch-button-glib.cpp -o watch-button-glib -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -lglib-2.0&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         g++ watch-button-glib.cpp -o watch-button-glib -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -lglib-2.0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Projects]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tommy</name></author>
	</entry>
	<entry>
		<id>https://tommy0804.ddns.net/index.php?title=Application_-_Monitor_GPIO_interrupt_in_userspace&amp;diff=123&amp;oldid=prev</id>
		<title>Tommy：​已建立頁面，內容為 &quot;== Monitor GPIO 4 interrupt == === watch-button-glib.cpp === &lt;pre&gt; #include &lt;glib.h&gt; #include &lt;fcntl.h&gt; #include &lt;iostream&gt; using namespace std; #define buf_sz 10 st…&quot;</title>
		<link rel="alternate" type="text/html" href="https://tommy0804.ddns.net/index.php?title=Application_-_Monitor_GPIO_interrupt_in_userspace&amp;diff=123&amp;oldid=prev"/>
		<updated>2018-08-23T02:57:26Z</updated>

		<summary type="html">&lt;p&gt;已建立頁面，內容為 &amp;quot;== Monitor GPIO 4 interrupt == === watch-button-glib.cpp === &amp;lt;pre&amp;gt; #include &amp;lt;glib.h&amp;gt; #include &amp;lt;fcntl.h&amp;gt; #include &amp;lt;iostream&amp;gt; using namespace std; #define buf_sz 10 st…&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新頁面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Monitor GPIO 4 interrupt ==&lt;br /&gt;
=== watch-button-glib.cpp ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;glib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
using namespace std;&lt;br /&gt;
#define buf_sz 10&lt;br /&gt;
static int onButtonEvent(GIOChannel *channel, GIOCondition condition, gpointer user_data)&lt;br /&gt;
{&lt;br /&gt;
        static char buf[buf_sz];&lt;br /&gt;
        cerr &amp;lt;&amp;lt; &amp;quot;onButtonEvent&amp;quot; &amp;lt;&amp;lt;endl;&lt;br /&gt;
        GError *error = 0;&lt;br /&gt;
        gsize bytes_read = 0;&lt;br /&gt;
        g_io_channel_seek_position(channel, 0, G_SEEK_SET, 0);&lt;br /&gt;
        GIOStatus rc = g_io_channel_read_chars(channel, buf, buf_sz - 1, &amp;amp;bytes_read, &amp;amp;error);&lt;br /&gt;
        cerr &amp;lt;&amp;lt; &amp;quot;rc:&amp;quot; &amp;lt;&amp;lt; rc &amp;lt;&amp;lt; &amp;quot; data:&amp;quot; &amp;lt;&amp;lt; buf &amp;lt;&amp;lt;endl;&lt;br /&gt;
        return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char** argv)&lt;br /&gt;
{&lt;br /&gt;
        GMainLoop* loop = g_main_loop_new(0,0);&lt;br /&gt;
        int fd = open(&amp;quot;/sys/class/gpio/gpio4/value&amp;quot;, O_RDONLY | O_NONBLOCK);&lt;br /&gt;
        GIOChannel* channel = g_io_channel_unix_new(fd);&lt;br /&gt;
        GIOCondition cond = GIOCondition( G_IO_PRI);&lt;br /&gt;
        guint id = g_io_add_watch(channel, cond, onButtonEvent, 0);&lt;br /&gt;
&lt;br /&gt;
        g_main_loop_run(loop);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Makefile ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
watch-button-glib: watch-button-glib.cpp Makefile&lt;br /&gt;
        g++ watch-button-glib.cpp -o watch-button-glib -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -lglib-2.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tommy</name></author>
	</entry>
</feed>