<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.yo-net.jp/index.php?action=history&amp;feed=atom&amp;title=Arduino_Mega_2560_LESSON%3A9_%E3%82%B5%E3%83%BC%E3%83%9C_interrupt.h</id>
	<title>Arduino Mega 2560 LESSON:9 サーボ interrupt.h - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.yo-net.jp/index.php?action=history&amp;feed=atom&amp;title=Arduino_Mega_2560_LESSON%3A9_%E3%82%B5%E3%83%BC%E3%83%9C_interrupt.h"/>
	<link rel="alternate" type="text/html" href="https://wiki.yo-net.jp/index.php?title=Arduino_Mega_2560_LESSON:9_%E3%82%B5%E3%83%BC%E3%83%9C_interrupt.h&amp;action=history"/>
	<updated>2026-10-11T01:33:54Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.38.2</generator>
	<entry>
		<id>https://wiki.yo-net.jp/index.php?title=Arduino_Mega_2560_LESSON:9_%E3%82%B5%E3%83%BC%E3%83%9C_interrupt.h&amp;diff=14097&amp;oldid=prev</id>
		<title>2026年10月10日 (土) 15:55にYo-netによる</title>
		<link rel="alternate" type="text/html" href="https://wiki.yo-net.jp/index.php?title=Arduino_Mega_2560_LESSON:9_%E3%82%B5%E3%83%BC%E3%83%9C_interrupt.h&amp;diff=14097&amp;oldid=prev"/>
		<updated>2026-10-10T15:55:25Z</updated>

		<summary type="html">&lt;p&gt;&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;ja&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年10月11日 (日) 00:55時点における版&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-l63&quot;&gt;63行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;63行目:&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;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.js?config=TeX-AMS_HTML-full&amp;quot;&amp;gt;&amp;lt;/script&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;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.js?config=TeX-AMS_HTML-full&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&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;script&amp;gt;&amp;lt;/yjavascript&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;script&amp;gt;&amp;lt;/yjavascript&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&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: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Arduino Mega 2560]]に戻る。&lt;/div&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;[[Arduino Mega 2560 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;LESSON:9 サーボ&lt;/ins&gt;]]に戻る。&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;br/&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;br/&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;freescript&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;div class=&amp;quot;hljs-wrap&amp;quot;&amp;gt;&amp;lt;pre data-label=&amp;quot;Arduino Code&amp;quot; class=&amp;quot;pre-wrap&amp;quot;&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;freescript&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;div class=&amp;quot;hljs-wrap&amp;quot;&amp;gt;&amp;lt;pre data-label=&amp;quot;Arduino Code&amp;quot; class=&amp;quot;pre-wrap&amp;quot;&amp;gt;&lt;/div&gt;&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-l414&quot;&gt;414行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;414行目:&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;　&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;　&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;br/&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;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&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: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Arduino Mega 2560]]に戻る。&lt;/div&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;[[Arduino Mega 2560 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;LESSON:9 サーボ&lt;/ins&gt;]]に戻る。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Yo-net</name></author>
	</entry>
	<entry>
		<id>https://wiki.yo-net.jp/index.php?title=Arduino_Mega_2560_LESSON:9_%E3%82%B5%E3%83%BC%E3%83%9C_interrupt.h&amp;diff=14096&amp;oldid=prev</id>
		<title>Yo-net: ページの作成:「&lt;yjavascript&gt;&lt;/script&gt; &lt;script&gt;     // 最初に実行されるスクリプト     document.addEventListener('DOMContentLoaded', () =&gt; {       const observer = new MutationObserver((mutations) =&gt; {         mutations.forEach((mutation) =&gt; {           mutation.addedNodes.forEach((node) =&gt; {             if (node.tagName === 'SCRIPT' &amp;amp;@@&amp;amp; node.textContent) {                 // JavaScriptコードを変換                 const originalCode = node.textContent;…」</title>
		<link rel="alternate" type="text/html" href="https://wiki.yo-net.jp/index.php?title=Arduino_Mega_2560_LESSON:9_%E3%82%B5%E3%83%BC%E3%83%9C_interrupt.h&amp;diff=14096&amp;oldid=prev"/>
		<updated>2026-10-10T15:54:24Z</updated>

		<summary type="html">&lt;p&gt;ページの作成:「&amp;lt;yjavascript&amp;gt;&amp;lt;/script&amp;gt; &amp;lt;script&amp;gt;     // 最初に実行されるスクリプト     document.addEventListener(&amp;#039;DOMContentLoaded&amp;#039;, () =&amp;gt; {       const observer = new MutationObserver((mutations) =&amp;gt; {         mutations.forEach((mutation) =&amp;gt; {           mutation.addedNodes.forEach((node) =&amp;gt; {             if (node.tagName === &amp;#039;SCRIPT&amp;#039; &amp;amp;@@&amp;amp; node.textContent) {                 // JavaScriptコードを変換                 const originalCode = node.textContent;…」&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;yjavascript&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    // 最初に実行されるスクリプト&lt;br /&gt;
    document.addEventListener('DOMContentLoaded', () =&amp;gt; {&lt;br /&gt;
      const observer = new MutationObserver((mutations) =&amp;gt; {&lt;br /&gt;
        mutations.forEach((mutation) =&amp;gt; {&lt;br /&gt;
          mutation.addedNodes.forEach((node) =&amp;gt; {&lt;br /&gt;
            if (node.tagName === 'SCRIPT' &amp;amp;amp;@@&amp;amp;amp; node.textContent) {&lt;br /&gt;
                // JavaScriptコードを変換&lt;br /&gt;
                const originalCode = node.textContent;&lt;br /&gt;
                const transformedCode = originalCode.replace(&amp;quot;&amp;amp;amp;&amp;amp;amp;&amp;quot;, &amp;quot;&amp;amp;amp;@@&amp;amp;amp;&amp;quot;);&lt;br /&gt;
              &lt;br /&gt;
                // 元のスクリプトを置き換え&lt;br /&gt;
                const newScript = document.createElement('script');&lt;br /&gt;
                newScript.textContent = transformedCode;&lt;br /&gt;
                node.replaceWith(newScript);&lt;br /&gt;
            }&lt;br /&gt;
          });&lt;br /&gt;
        });&lt;br /&gt;
      });&lt;br /&gt;
&lt;br /&gt;
      // `&amp;lt;head&amp;gt;` または `&amp;lt;body&amp;gt;` に挿入されるスクリプトを監視&lt;br /&gt;
      observer.observe(document.head, { childList: true });&lt;br /&gt;
      observer.observe(document.body, { childList: true });&lt;br /&gt;
    });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/vs2015.css&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;https://wiki.yo-net.jp/custom.css&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script src=&amp;quot;https://wiki.yo-net.jp/highlight/highlight.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script src=&amp;quot;https://wiki.yo-net.jp/custom.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/x-mathjax-config&amp;quot;&amp;gt;&lt;br /&gt;
  MathJax.Ajax.config.path[&amp;quot;Contrib&amp;quot;]=&amp;quot;https://wiki.yo-net.jp/mathjax/&amp;quot;;&lt;br /&gt;
  MathJax.Hub.Register.StartupHook(&amp;quot;TeX Jax Ready&amp;quot;,function (){&lt;br /&gt;
    MathJax.Hub.Insert(&lt;br /&gt;
      MathJax.InputJax.TeX.Definitions.macros,{&lt;br /&gt;
        cancel: [&amp;quot;Extension&amp;quot;,&amp;quot;cancel&amp;quot;], &lt;br /&gt;
        bcancel: [&amp;quot;Extension&amp;quot;,&amp;quot;cancel&amp;quot;], &lt;br /&gt;
        xcancel: [&amp;quot;Extension&amp;quot;,&amp;quot;cancel&amp;quot;], &lt;br /&gt;
        cancelto: [&amp;quot;Extension&amp;quot;,&amp;quot;cancel&amp;quot;]&lt;br /&gt;
      }&lt;br /&gt;
    );&lt;br /&gt;
  }); &lt;br /&gt;
  MathJax.Hub.Config({&lt;br /&gt;
    tex2jax:{&lt;br /&gt;
      displayMath: [['$$', '$$'],['\\[', '\\]']],  //displayスタイル数式に利用する記号の指定&lt;br /&gt;
      inlineMath:  [['\\@', '\\@'],['\\(', '\\)']],//inlineスタイル数式に利用する記号の指定&lt;br /&gt;
                                                   //ここは使う人が自由に設定する部分です。&lt;br /&gt;
      processEscapes: true&lt;br /&gt;
    },&lt;br /&gt;
    TeX:{&lt;br /&gt;
//    equationNumbers:{autoNumber: &amp;quot;AMS&amp;quot;}, &lt;br /&gt;
      extensions: [&amp;quot;[Contrib]/physics/physics.js&amp;quot;,&amp;quot;[Contrib]/siunitx/siunitx.js&amp;quot;, &amp;quot;color.js&amp;quot;, &amp;quot;cancel.js&amp;quot;]&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;HTML-CSS&amp;quot;: {&lt;br /&gt;
      availableFonts: [],&lt;br /&gt;
      preferredFont: null,&lt;br /&gt;
      webFont: &amp;quot;Neo-Euler&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.js?config=TeX-AMS_HTML-full&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&amp;lt;/yjavascript&amp;gt;&lt;br /&gt;
[[Arduino Mega 2560]]に戻る。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;freescript&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;div class=&amp;quot;hljs-wrap&amp;quot;&amp;gt;&amp;lt;pre data-label=&amp;quot;Arduino Code&amp;quot; class=&amp;quot;pre-wrap&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code class=&amp;quot;cpp&amp;quot;&amp;gt;/* Copyright (c) 2002,2005,2007 Marek Michalkiewicz&lt;br /&gt;
   Copyright (c) 2007, Dean Camera&lt;br /&gt;
&lt;br /&gt;
   All rights reserved.&lt;br /&gt;
&lt;br /&gt;
   Redistribution and use in source and binary forms, with or without&lt;br /&gt;
   modification, are permitted provided that the following conditions are met:&lt;br /&gt;
&lt;br /&gt;
   * Redistributions of source code must retain the above copyright&lt;br /&gt;
     notice, this list of conditions and the following disclaimer.&lt;br /&gt;
&lt;br /&gt;
   * Redistributions in binary form must reproduce the above copyright&lt;br /&gt;
     notice, this list of conditions and the following disclaimer in&lt;br /&gt;
     the documentation and/or other materials provided with the&lt;br /&gt;
     distribution.&lt;br /&gt;
&lt;br /&gt;
   * Neither the name of the copyright holders nor the names of&lt;br /&gt;
     contributors may be used to endorse or promote products derived&lt;br /&gt;
     from this software without specific prior written permission.&lt;br /&gt;
&lt;br /&gt;
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &amp;quot;AS IS&amp;quot;&lt;br /&gt;
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE&lt;br /&gt;
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE&lt;br /&gt;
  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE&lt;br /&gt;
  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR&lt;br /&gt;
  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF&lt;br /&gt;
  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS&lt;br /&gt;
  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN&lt;br /&gt;
  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)&lt;br /&gt;
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE&lt;br /&gt;
  POSSIBILITY OF SUCH DAMAGE. */&lt;br /&gt;
&lt;br /&gt;
/* $Id$ */&lt;br /&gt;
&lt;br /&gt;
#ifndef _AVR_INTERRUPT_H_&lt;br /&gt;
#define _AVR_INTERRUPT_H_&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;avr/io.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#if !defined(__DOXYGEN__) &amp;amp;&amp;amp; !defined(__STRINGIFY)&lt;br /&gt;
/* Auxiliary macro for ISR_ALIAS(). */&lt;br /&gt;
#define __STRINGIFY(x) #x&lt;br /&gt;
#endif /* !defined(__DOXYGEN__) */&lt;br /&gt;
&lt;br /&gt;
/** &lt;br /&gt;
\file &lt;br /&gt;
\@{ &lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/** \name Global manipulation of the interrupt flag&lt;br /&gt;
&lt;br /&gt;
    The global interrupt flag is maintained in the I bit of the status&lt;br /&gt;
    register (SREG).&lt;br /&gt;
&lt;br /&gt;
    Handling interrupts frequently requires attention regarding atomic&lt;br /&gt;
    access to objects that could be altered by code running within an&lt;br /&gt;
    interrupt context, see &amp;lt;util/atomic.h&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
    Frequently, interrupts are being disabled for periods of time in&lt;br /&gt;
    order to perform certain operations without being disturbed; see&lt;br /&gt;
    \ref optim_code_reorder for things to be taken into account with&lt;br /&gt;
    respect to compiler optimizations.&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
#if defined(__DOXYGEN__)&lt;br /&gt;
/** \def sei()&lt;br /&gt;
    \ingroup avr_interrupts&lt;br /&gt;
&lt;br /&gt;
    Enables interrupts by setting the global interrupt mask. This function&lt;br /&gt;
    actually compiles into a single line of assembly, so there is no function&lt;br /&gt;
    call overhead.  However, the macro also implies a &amp;lt;i&amp;gt;memory barrier&amp;lt;/i&amp;gt;&lt;br /&gt;
    which can cause additional loss of optimization.&lt;br /&gt;
&lt;br /&gt;
    In order to implement atomic access to multi-byte objects,&lt;br /&gt;
    consider using the macros from &amp;lt;util/atomic.h&amp;gt;, rather than&lt;br /&gt;
    implementing them manually with cli() and sei().&lt;br /&gt;
*/&lt;br /&gt;
#define sei()&lt;br /&gt;
#else  /* !DOXYGEN */&lt;br /&gt;
# define sei()  __asm__ __volatile__ (&amp;quot;sei&amp;quot; ::: &amp;quot;memory&amp;quot;)&lt;br /&gt;
#endif /* DOXYGEN */&lt;br /&gt;
&lt;br /&gt;
#if defined(__DOXYGEN__)&lt;br /&gt;
/** \def cli()&lt;br /&gt;
    \ingroup avr_interrupts&lt;br /&gt;
&lt;br /&gt;
    Disables all interrupts by clearing the global interrupt mask. This function&lt;br /&gt;
    actually compiles into a single line of assembly, so there is no function&lt;br /&gt;
    call overhead.  However, the macro also implies a &amp;lt;i&amp;gt;memory barrier&amp;lt;/i&amp;gt;&lt;br /&gt;
    which can cause additional loss of optimization.&lt;br /&gt;
&lt;br /&gt;
    In order to implement atomic access to multi-byte objects,&lt;br /&gt;
    consider using the macros from &amp;lt;util/atomic.h&amp;gt;, rather than&lt;br /&gt;
    implementing them manually with cli() and sei().&lt;br /&gt;
*/&lt;br /&gt;
#define cli()&lt;br /&gt;
#else  /* !DOXYGEN */&lt;br /&gt;
# define cli()  __asm__ __volatile__ (&amp;quot;cli&amp;quot; ::: &amp;quot;memory&amp;quot;)&lt;br /&gt;
#endif /* DOXYGEN */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/** \name Macros for writing interrupt handler functions */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if defined(__DOXYGEN__)&lt;br /&gt;
/** \def ISR(vector [, attributes])&lt;br /&gt;
    \ingroup avr_interrupts&lt;br /&gt;
&lt;br /&gt;
    Introduces an interrupt handler function (interrupt service&lt;br /&gt;
    routine) that runs with global interrupts initially disabled&lt;br /&gt;
    by default with no attributes specified.&lt;br /&gt;
&lt;br /&gt;
    The attributes are optional and alter the behaviour and resultant&lt;br /&gt;
    generated code of the interrupt routine. Multiple attributes may&lt;br /&gt;
    be used for a single function, with a space seperating each&lt;br /&gt;
    attribute.&lt;br /&gt;
&lt;br /&gt;
    Valid attributes are ISR_BLOCK, ISR_NOBLOCK, ISR_NAKED and&lt;br /&gt;
    ISR_ALIASOF(vect).&lt;br /&gt;
&lt;br /&gt;
    \c vector must be one of the interrupt vector names that are&lt;br /&gt;
    valid for the particular MCU type.&lt;br /&gt;
*/&lt;br /&gt;
#  define ISR(vector, [attributes])&lt;br /&gt;
#else  /* real code */&lt;br /&gt;
&lt;br /&gt;
#if (__GNUC__ == 4 &amp;amp;&amp;amp; __GNUC_MINOR__ &amp;gt;= 1) || (__GNUC__ &amp;gt; 4)&lt;br /&gt;
#  define __INTR_ATTRS used, externally_visible&lt;br /&gt;
#else /* GCC &amp;lt; 4.1 */&lt;br /&gt;
#  define __INTR_ATTRS used&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
#  define ISR(vector, ...)            \&lt;br /&gt;
    extern &amp;quot;C&amp;quot; void vector (void) __attribute__ ((signal,__INTR_ATTRS)) __VA_ARGS__; \&lt;br /&gt;
    void vector (void)&lt;br /&gt;
#else&lt;br /&gt;
#  define ISR(vector, ...)            \&lt;br /&gt;
    void vector (void) __attribute__ ((signal,__INTR_ATTRS)) __VA_ARGS__; \&lt;br /&gt;
    void vector (void)&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#endif /* DOXYGEN */&lt;br /&gt;
&lt;br /&gt;
#if defined(__DOXYGEN__)&lt;br /&gt;
/** \def SIGNAL(vector)&lt;br /&gt;
    \ingroup avr_interrupts&lt;br /&gt;
&lt;br /&gt;
    Introduces an interrupt handler function that runs with global interrupts&lt;br /&gt;
    initially disabled.&lt;br /&gt;
&lt;br /&gt;
    This is the same as the ISR macro without optional attributes.&lt;br /&gt;
    \deprecated Do not use SIGNAL() in new code. Use ISR() instead.&lt;br /&gt;
*/&lt;br /&gt;
#  define SIGNAL(vector)&lt;br /&gt;
#else  /* real code */&lt;br /&gt;
&lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
#  define SIGNAL(vector)					\&lt;br /&gt;
    extern &amp;quot;C&amp;quot; void vector(void) __attribute__ ((signal, __INTR_ATTRS));	\&lt;br /&gt;
    void vector (void)&lt;br /&gt;
#else&lt;br /&gt;
#  define SIGNAL(vector)					\&lt;br /&gt;
    void vector (void) __attribute__ ((signal, __INTR_ATTRS));		\&lt;br /&gt;
    void vector (void)&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#endif /* DOXYGEN */&lt;br /&gt;
&lt;br /&gt;
#if defined(__DOXYGEN__)&lt;br /&gt;
/** \def EMPTY_INTERRUPT(vector)&lt;br /&gt;
    \ingroup avr_interrupts&lt;br /&gt;
&lt;br /&gt;
    Defines an empty interrupt handler function. This will not generate&lt;br /&gt;
    any prolog or epilog code and will only return from the ISR. Do not&lt;br /&gt;
    define a function body as this will define it for you.&lt;br /&gt;
    Example:&lt;br /&gt;
    \code EMPTY_INTERRUPT(ADC_vect);\endcode */&lt;br /&gt;
#  define EMPTY_INTERRUPT(vector)&lt;br /&gt;
#else  /* real code */&lt;br /&gt;
&lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
#  define EMPTY_INTERRUPT(vector)                \&lt;br /&gt;
    extern &amp;quot;C&amp;quot; void vector(void) __attribute__ ((signal,naked,__INTR_ATTRS));    \&lt;br /&gt;
    void vector (void) {  __asm__ __volatile__ (&amp;quot;reti&amp;quot; ::); }&lt;br /&gt;
#else&lt;br /&gt;
#  define EMPTY_INTERRUPT(vector)                \&lt;br /&gt;
    void vector (void) __attribute__ ((signal,naked,__INTR_ATTRS));    \&lt;br /&gt;
    void vector (void) { __asm__ __volatile__ (&amp;quot;reti&amp;quot; ::); }&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#endif /* DOXYGEN */&lt;br /&gt;
&lt;br /&gt;
#if defined(__DOXYGEN__)&lt;br /&gt;
/** \def ISR_ALIAS(vector, target_vector)&lt;br /&gt;
    \ingroup avr_interrupts&lt;br /&gt;
&lt;br /&gt;
    Aliases a given vector to another one in the same manner as the&lt;br /&gt;
    ISR_ALIASOF attribute for the ISR() macro. Unlike the ISR_ALIASOF&lt;br /&gt;
    attribute macro however, this is compatible for all versions of&lt;br /&gt;
    GCC rather than just GCC version 4.2 onwards.&lt;br /&gt;
&lt;br /&gt;
    \note This macro creates a trampoline function for the aliased&lt;br /&gt;
    macro.  This will result in a two cycle penalty for the aliased&lt;br /&gt;
    vector compared to the ISR the vector is aliased to, due to the&lt;br /&gt;
    JMP/RJMP opcode used.&lt;br /&gt;
&lt;br /&gt;
    \deprecated&lt;br /&gt;
    For new code, the use of ISR(..., ISR_ALIASOF(...))  is&lt;br /&gt;
    recommended.&lt;br /&gt;
&lt;br /&gt;
    Example:&lt;br /&gt;
    \code&lt;br /&gt;
    ISR(INT0_vect)&lt;br /&gt;
    {&lt;br /&gt;
        PORTB = 42;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    ISR_ALIAS(INT1_vect, INT0_vect);&lt;br /&gt;
    \endcode &lt;br /&gt;
    &lt;br /&gt;
*/&lt;br /&gt;
#  define ISR_ALIAS(vector, target_vector)&lt;br /&gt;
#else /* real code */&lt;br /&gt;
&lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
#  if defined(__AVR_MEGA__) &amp;amp;&amp;amp; __AVR_MEGA__&lt;br /&gt;
#    define ISR_ALIAS(vector, tgt) extern &amp;quot;C&amp;quot; void vector (void) \&lt;br /&gt;
	__attribute__((signal, naked, __INTR_ATTRS)); \&lt;br /&gt;
	void vector (void) { asm volatile (&amp;quot;jmp &amp;quot; __STRINGIFY(tgt) ::); }&lt;br /&gt;
#  else /* !__AVR_MEGA */&lt;br /&gt;
#    define ISR_ALIAS(vector, tgt) extern &amp;quot;C&amp;quot; void vector (void) \&lt;br /&gt;
	__attribute__((signal, naked, __INTR_ATTRS)); \&lt;br /&gt;
	void vector (void) { asm volatile (&amp;quot;rjmp &amp;quot; __STRINGIFY(tgt) ::); }&lt;br /&gt;
#  endif  /* __AVR_MEGA__ */&lt;br /&gt;
#else	  /* !__cplusplus */&lt;br /&gt;
#  if defined(__AVR_MEGA__) &amp;amp;&amp;amp; __AVR_MEGA__&lt;br /&gt;
#  define ISR_ALIAS(vector, tgt) void vector (void) \&lt;br /&gt;
	__attribute__((signal, naked, __INTR_ATTRS)); \&lt;br /&gt;
	void vector (void) { asm volatile (&amp;quot;jmp &amp;quot; __STRINGIFY(tgt) ::); }&lt;br /&gt;
#  else /* !__AVR_MEGA */&lt;br /&gt;
#  define ISR_ALIAS(vector, tgt) void vector (void) \&lt;br /&gt;
	__attribute__((signal, naked, __INTR_ATTRS)); \&lt;br /&gt;
	void vector (void) { asm volatile (&amp;quot;rjmp &amp;quot; __STRINGIFY(tgt) ::); }&lt;br /&gt;
#  endif  /* __AVR_MEGA__ */&lt;br /&gt;
#endif	/* __cplusplus */&lt;br /&gt;
&lt;br /&gt;
#endif /* DOXYGEN */&lt;br /&gt;
&lt;br /&gt;
#if defined(__DOXYGEN__)&lt;br /&gt;
/** \def reti()&lt;br /&gt;
    \ingroup avr_interrupts&lt;br /&gt;
&lt;br /&gt;
    Returns from an interrupt routine, enabling global interrupts. This should&lt;br /&gt;
    be the last command executed before leaving an ISR defined with the ISR_NAKED&lt;br /&gt;
    attribute.&lt;br /&gt;
&lt;br /&gt;
    This macro actually compiles into a single line of assembly, so there is&lt;br /&gt;
    no function call overhead.&lt;br /&gt;
*/&lt;br /&gt;
#  define reti()&lt;br /&gt;
#else  /* !や&lt;br /&gt;
#  define reti()  __asm__ __volatile__ (&amp;quot;reti&amp;quot; ::)&lt;br /&gt;
#endif /* DOXYGEN */&lt;br /&gt;
&lt;br /&gt;
#if defined(__DOXYGEN__)&lt;br /&gt;
/** \def BADISR_vect&lt;br /&gt;
    \ingroup avr_interrupts&lt;br /&gt;
&lt;br /&gt;
    \code #include &amp;lt;avr/interrupt.h&amp;gt; \endcode&lt;br /&gt;
&lt;br /&gt;
    This is a vector which is aliased to __vector_default, the vector&lt;br /&gt;
    executed when an ISR fires with no accompanying ISR handler. This&lt;br /&gt;
    may be used along with the ISR() macro to create a catch-all for&lt;br /&gt;
    undefined but used ISRs for debugging purposes.&lt;br /&gt;
*/&lt;br /&gt;
#  define BADISR_vect&lt;br /&gt;
#else  /* !DOXYGEN */&lt;br /&gt;
#  define BADISR_vect __vector_default&lt;br /&gt;
#endif /* DOXYGEN */&lt;br /&gt;
&lt;br /&gt;
/** \name ISR attributes */&lt;br /&gt;
&lt;br /&gt;
#if defined(__DOXYGEN__)&lt;br /&gt;
/** \def ISR_BLOCK&lt;br /&gt;
    \ingroup avr_interrupts&lt;br /&gt;
&lt;br /&gt;
    Identical to an ISR with no attributes specified. Global&lt;br /&gt;
    interrupts are initially disabled by the AVR hardware when&lt;br /&gt;
    entering the ISR, without the compiler modifying this state.&lt;br /&gt;
&lt;br /&gt;
    Use this attribute in the attributes parameter of the ISR macro.&lt;br /&gt;
*/&lt;br /&gt;
#  define ISR_BLOCK&lt;br /&gt;
&lt;br /&gt;
/** \def ISR_NOBLOCK&lt;br /&gt;
    \ingroup avr_interrupts&lt;br /&gt;
&lt;br /&gt;
    ISR runs with global interrupts initially enabled.  The interrupt&lt;br /&gt;
    enable flag is activated by the compiler as early as possible&lt;br /&gt;
    within the ISR to ensure minimal processing delay for nested&lt;br /&gt;
    interrupts.&lt;br /&gt;
&lt;br /&gt;
    This may be used to create nested ISRs, however care should be&lt;br /&gt;
    taken to avoid stack overflows, or to avoid infinitely entering&lt;br /&gt;
    the ISR for those cases where the AVR hardware does not clear the&lt;br /&gt;
    respective interrupt flag before entering the ISR.&lt;br /&gt;
&lt;br /&gt;
    Use this attribute in the attributes parameter of the ISR macro.&lt;br /&gt;
*/&lt;br /&gt;
#  define ISR_NOBLOCK&lt;br /&gt;
&lt;br /&gt;
/** \def ISR_NAKED&lt;br /&gt;
    \ingroup avr_interrupts&lt;br /&gt;
&lt;br /&gt;
    ISR is created with no prologue or epilogue code. The user code is&lt;br /&gt;
    responsible for preservation of the machine state including the&lt;br /&gt;
    SREG register, as well as placing a reti() at the end of the&lt;br /&gt;
    interrupt routine.&lt;br /&gt;
&lt;br /&gt;
    Use this attribute in the attributes parameter of the ISR macro.&lt;br /&gt;
*/&lt;br /&gt;
#  define ISR_NAKED&lt;br /&gt;
&lt;br /&gt;
/** \def ISR_ALIASOF(target_vector)&lt;br /&gt;
    \ingroup avr_interrupts&lt;br /&gt;
&lt;br /&gt;
    The ISR is linked to another ISR, specified by the vect parameter.&lt;br /&gt;
    This is compatible with GCC 4.2 and greater only.&lt;br /&gt;
&lt;br /&gt;
    Use this attribute in the attributes parameter of the ISR macro.&lt;br /&gt;
*/&lt;br /&gt;
#  define ISR_ALIASOF(target_vector)&lt;br /&gt;
#else  /* !DOXYGEN */&lt;br /&gt;
#  define ISR_BLOCK&lt;br /&gt;
#  define ISR_NOBLOCK    __attribute__((interrupt))&lt;br /&gt;
#  define ISR_NAKED      __attribute__((naked))&lt;br /&gt;
#  define ISR_ALIASOF(v) __attribute__((alias(__STRINGIFY(v))))&lt;br /&gt;
#endif /* DOXYGEN */&lt;br /&gt;
&lt;br /&gt;
/* \@} */&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;script&amp;gt;&amp;lt;/freescript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
　&lt;br /&gt;
&lt;br /&gt;
[[Arduino Mega 2560]]に戻る。&lt;/div&gt;</summary>
		<author><name>Yo-net</name></author>
	</entry>
</feed>