<ahref="macros_8h.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="comment">/* Copyright (C) 2011 Circuits At Home, LTD. All rights reserved.</span></div>
<divclass="line"><aname="l00003"></a><spanclass="lineno"> 3</span> <spanclass="comment">This program is free software; you can redistribute it and/or modify</span></div>
<divclass="line"><aname="l00004"></a><spanclass="lineno"> 4</span> <spanclass="comment">it under the terms of the GNU General Public License as published by</span></div>
<divclass="line"><aname="l00005"></a><spanclass="lineno"> 5</span> <spanclass="comment">the Free Software Foundation; either version 2 of the License, or</span></div>
<divclass="line"><aname="l00006"></a><spanclass="lineno"> 6</span> <spanclass="comment">(at your option) any later version.</span></div>
<divclass="line"><aname="l00008"></a><spanclass="lineno"> 8</span> <spanclass="comment">This program is distributed in the hope that it will be useful,</span></div>
<divclass="line"><aname="l00009"></a><spanclass="lineno"> 9</span> <spanclass="comment">but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
<divclass="line"><aname="l00010"></a><spanclass="lineno"> 10</span> <spanclass="comment">MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div>
<divclass="line"><aname="l00011"></a><spanclass="lineno"> 11</span> <spanclass="comment">GNU General Public License for more details.</span></div>
<divclass="line"><aname="l00013"></a><spanclass="lineno"> 13</span> <spanclass="comment">You should have received a copy of the GNU General Public License</span></div>
<divclass="line"><aname="l00014"></a><spanclass="lineno"> 14</span> <spanclass="comment">along with this program; if not, write to the Free Software</span></div>
<divclass="line"><aname="l00015"></a><spanclass="lineno"> 15</span> <spanclass="comment">Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span></div>
<divclass="line"><aname="l00026"></a><spanclass="lineno"> 26</span> <spanclass="preprocessor">#error "Never include macros.h directly; include Usb.h instead"</span></div>
<divclass="line"><aname="l00043"></a><spanclass="lineno"> 43</span> <spanclass="comment">// Note: Use this if your compiler generates horrible assembler!</span></div>
<divclass="line"><aname="l00053"></a><spanclass="lineno"> 53</span> <spanclass="comment">// Note: The cast alone to uint8_t is actually enough.</span></div>
<divclass="line"><aname="l00054"></a><spanclass="lineno"> 54</span> <spanclass="comment">// GCC throws out the "& 0xff", and the size is no different.</span></div>
<divclass="line"><aname="l00055"></a><spanclass="lineno"> 55</span> <spanclass="comment">// Some compilers need it.</span></div>
<divclass="line"><aname="l00056"></a><spanclass="lineno"><aclass="line"href="macros_8h.html#a773ca2920fd4808c94e6645a7a8d63d1"> 56</a></span> <spanclass="preprocessor">#define BGRAB0(__usi__) ((uint8_t)((__usi__) & 0xff ))</span></div>
<divclass="line"><aname="l00057"></a><spanclass="lineno"><aclass="line"href="macros_8h.html#a483a8ceb644d44744abff34f61cc5442"> 57</a></span> <spanclass="preprocessor">#define BGRAB1(__usi__) ((uint8_t)(((__usi__) >> 8) & 0xff))</span></div>
<divclass="line"><aname="l00058"></a><spanclass="lineno"><aclass="line"href="macros_8h.html#a49c9ebd69fbb93bd97f9051f592390c6"> 58</a></span> <spanclass="preprocessor">#define BGRAB2(__usi__) ((uint8_t)(((__usi__) >> 16) & 0xff))</span></div>
<divclass="line"><aname="l00059"></a><spanclass="lineno"><aclass="line"href="macros_8h.html#a9860e9931085c9e299185903eeb0e728"> 59</a></span> <spanclass="preprocessor">#define BGRAB3(__usi__) ((uint8_t)(((__usi__) >> 24) & 0xff))</span></div>
<divclass="line"><aname="l00060"></a><spanclass="lineno"><aclass="line"href="macros_8h.html#a2e09ee6521484d766b749fa78424e6de"> 60</a></span> <spanclass="preprocessor">#define BGRAB4(__usi__) ((uint8_t)(((__usi__) >> 32) & 0xff))</span></div>
<divclass="line"><aname="l00061"></a><spanclass="lineno"><aclass="line"href="macros_8h.html#af7841a592674a3da24f7f93c51efc802"> 61</a></span> <spanclass="preprocessor">#define BGRAB5(__usi__) ((uint8_t)(((__usi__) >> 40) & 0xff))</span></div>
<divclass="line"><aname="l00062"></a><spanclass="lineno"><aclass="line"href="macros_8h.html#abe11d76b3c0fd5c7eb99028da5c143fd"> 62</a></span> <spanclass="preprocessor">#define BGRAB6(__usi__) ((uint8_t)(((__usi__) >> 48) & 0xff))</span></div>
<divclass="line"><aname="l00063"></a><spanclass="lineno"><aclass="line"href="macros_8h.html#ae6f83d8945d4b4aaeb0b6bcd241f4d41"> 63</a></span> <spanclass="preprocessor">#define BGRAB7(__usi__) ((uint8_t)(((__usi__) >> 56) & 0xff))</span></div>
<divclass="line"><aname="l00073"></a><spanclass="lineno"> 73</span> <spanclass="comment">// These are the smallest and fastest ways I have found so far in pure C/C++.</span></div>
<divclass="line"><aname="l00080"></a><spanclass="lineno"> 80</span> <spanclass="comment"> * Debug macros: Strings are stored in progmem (flash) instead of RAM.</span></div>