亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? rprintf_8c-source.html

?? ATMEL的AVR單片機庫文件
?? HTML
?? 第 1 頁 / 共 4 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Procyon AVRlib: rprintf.c Source File</title><link href="dox.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.6 --><div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div><h1>rprintf.c</h1><a href="rprintf_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*! \file rprintf.c \brief printf routine and associated routines. */</span>00002 <span class="comment">//*****************************************************************************</span>00003 <span class="comment">//</span>00004 <span class="comment">// File Name    : 'rprintf.c'</span>00005 <span class="comment">// Title        : printf routine and associated routines</span>00006 <span class="comment">// Author       : Pascal Stang - Copyright (C) 2000-2002</span>00007 <span class="comment">// Created      : 2000.12.26</span>00008 <span class="comment">// Revised      : 2003.5.1</span>00009 <span class="comment">// Version      : 1.0</span>00010 <span class="comment">// Target MCU   : Atmel AVR series and other targets</span>00011 <span class="comment">// Editor Tabs  : 4</span>00012 <span class="comment">//</span>00013 <span class="comment">// NOTE: This code is currently below version 1.0, and therefore is considered</span>00014 <span class="comment">// to be lacking in some functionality or documentation, or may not be fully</span>00015 <span class="comment">// tested.  Nonetheless, you can expect most functions to work.</span>00016 <span class="comment">//</span>00017 <span class="comment">// This code is distributed under the GNU Public License</span>00018 <span class="comment">//      which can be found at http://www.gnu.org/licenses/gpl.txt</span>00019 <span class="comment">//</span>00020 <span class="comment">//*****************************************************************************</span>00021 00022 <span class="preprocessor">#include &lt;avr/pgmspace.h&gt;</span>00023 <span class="comment">//#include &lt;string-avr.h&gt;</span>00024 <span class="comment">//#include &lt;stdlib.h&gt;</span>00025 <span class="preprocessor">#include &lt;stdarg.h&gt;</span>00026 <span class="preprocessor">#include "<a class="code" href="global_8h.html">global.h</a>"</span>00027 <span class="preprocessor">#include "<a class="code" href="rprintf_8h.html">rprintf.h</a>"</span>00028 00029 <span class="preprocessor">#ifndef TRUE</span>00030 <span class="preprocessor"></span><span class="preprocessor">    #define TRUE    -1</span>00031 <span class="preprocessor"></span><span class="preprocessor">    #define FALSE   0</span>00032 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00033 <span class="preprocessor"></span>00034 <span class="preprocessor">#define INF     32766   // maximum field size to print</span>00035 <span class="preprocessor"></span><span class="preprocessor">#define READMEMBYTE(a,char_ptr) ((a)?(PRG_RDB(char_ptr)):(*char_ptr))</span>00036 <span class="preprocessor"></span>00037 <span class="preprocessor">#ifdef RPRINTF_COMPLEX</span>00038 <span class="preprocessor"></span>    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> buf[128];00039 <span class="preprocessor">#endif</span>00040 <span class="preprocessor"></span>00041 <span class="comment">// use this to store hex conversion in RAM</span>00042 <span class="comment">//static char HexChars[] = "0123456789ABCDEF";</span>00043 <span class="comment">// use this to store hex conversion in program memory</span>00044 <span class="comment">//static prog_char HexChars[] = "0123456789ABCDEF";</span>00045 <span class="keyword">static</span> <span class="keywordtype">char</span> __attribute__ ((progmem)) HexChars[] = <span class="stringliteral">"0123456789ABCDEF"</span>;00046 00047 <span class="comment">// function pointer to single character output routine</span>00048 <span class="keyword">static</span> void (*rputchar)(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> c);00049 00050 <span class="comment">// *** rprintf initialization ***</span>00051 <span class="comment">// you must call this function once and supply the character output</span>00052 <span class="comment">// routine before using other functions in this library</span>00053 <span class="keywordtype">void</span> <a class="code" href="rprintf_8h.html#a6">rprintfInit</a>(<span class="keywordtype">void</span> (*putchar_func)(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> c))00054 {00055     rputchar = putchar_func;00056 }00057 00058 <span class="comment">// *** rprintfChar ***</span>00059 <span class="comment">// send a character/byte to the current output device</span><a name="l00060"></a><a class="code" href="rprintf_8h.html#a7">00060</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="rprintf_8h.html#a7">rprintfChar</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> c)00061 {00062     <span class="comment">// send character</span>00063     rputchar(c);00064 }00065 00066 <span class="comment">// *** rprintfStr ***</span>00067 <span class="comment">// prints a null-terminated string stored in RAM</span><a name="l00068"></a><a class="code" href="rprintf_8h.html#a8">00068</a> <span class="keywordtype">void</span> <a class="code" href="rprintf_8h.html#a8">rprintfStr</a>(<span class="keywordtype">char</span> str[])00069 {00070     <span class="comment">// send a string stored in RAM</span>00071     <span class="comment">// check to make sure we have a good pointer</span>00072     <span class="keywordflow">if</span> (!str) <span class="keywordflow">return</span>;00073 00074     <span class="comment">// print the string until a null-terminator</span>00075     <span class="keywordflow">while</span> (*str)00076         <a class="code" href="rprintf_8h.html#a7">rprintfChar</a>(*str++);00077 }00078 00079 <span class="comment">// *** rprintfStrLen ***</span>00080 <span class="comment">// prints a section of a string stored in RAM</span>00081 <span class="comment">// begins printing at position indicated by &lt;start&gt;</span>00082 <span class="comment">// prints number of characters indicated by &lt;len&gt;</span><a name="l00083"></a><a class="code" href="rprintf_8h.html#a9">00083</a> <span class="keywordtype">void</span> <a class="code" href="rprintf_8h.html#a9">rprintfStrLen</a>(<span class="keywordtype">char</span> str[], <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> start, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> len)00084 {00085     <span class="keyword">register</span> <span class="keywordtype">int</span> i=0;00086 00087     <span class="comment">// check to make sure we have a good pointer</span>00088     <span class="keywordflow">if</span> (!str) <span class="keywordflow">return</span>;00089     <span class="comment">// spin through characters up to requested start</span>00090     <span class="comment">// keep going as long as there's no null</span>00091     <span class="keywordflow">while</span>((i++&lt;start) &amp;&amp; (*str++));00092 <span class="comment">//  for(i=0; i&lt;start; i++)</span>00093 <span class="comment">//  {</span>00094 <span class="comment">//      // keep steping through string as long as there's no null</span>00095 <span class="comment">//      if(*str) str++;</span>00096 <span class="comment">//  }</span>00097 00098     <span class="comment">// then print exactly len characters</span>00099     <span class="keywordflow">for</span>(i=0; i&lt;len; i++)00100     {00101         <span class="comment">// print data out of the string as long as we haven't reached a null yet</span>00102         <span class="comment">// at the null, start printing spaces</span>00103         <span class="keywordflow">if</span>(*str)00104             <a class="code" href="rprintf_8h.html#a7">rprintfChar</a>(*str++);00105         <span class="keywordflow">else</span>00106             <a class="code" href="rprintf_8h.html#a7">rprintfChar</a>(<span class="charliteral">' '</span>);00107     }00108 00109 }00110 00111 <span class="comment">// *** rprintfProgStr ***</span>00112 <span class="comment">// prints a null-terminated string stored in program ROM</span><a name="l00113"></a><a class="code" href="rprintf_8h.html#a10">00113</a> <span class="keywordtype">void</span> <a class="code" href="rprintf_8h.html#a10">rprintfProgStr</a>(<span class="keyword">const</span> prog_char str[])00114 {00115     <span class="comment">// print a string stored in program memory</span>00116     <span class="keyword">register</span> <span class="keywordtype">char</span> c;00117 00118     <span class="comment">// check to make sure we have a good pointer</span>00119     <span class="keywordflow">if</span> (!str) <span class="keywordflow">return</span>;00120     00121     <span class="comment">// print the string until the null-terminator</span>00122     <span class="keywordflow">while</span>((c = PRG_RDB(str++)))00123         <a class="code" href="rprintf_8h.html#a7">rprintfChar</a>(c);00124 }00125 00126 <span class="comment">// *** rprintfCRLF ***</span>00127 <span class="comment">// prints carriage return and line feed</span><a name="l00128"></a><a class="code" href="rprintf_8h.html#a11">00128</a> <span class="keywordtype">void</span> <a class="code" href="rprintf_8c.html#a9">rprintfCRLF</a>(<span class="keywordtype">void</span>)00129 {00130     <span class="comment">// print CR/LF</span>00131     <a class="code" href="rprintf_8h.html#a7">rprintfChar</a>(<span class="charliteral">'\r'</span>);00132     <a class="code" href="rprintf_8h.html#a7">rprintfChar</a>(<span class="charliteral">'\n'</span>);00133 }00134 00135 <span class="comment">// *** rprintfu04 ***</span>00136 <span class="comment">// prints an unsigned 4-bit number in hex (1 digit)</span><a name="l00137"></a><a class="code" href="rprintf_8h.html#a12">00137</a> <span class="keywordtype">void</span> <a class="code" href="rprintf_8h.html#a12">rprintfu04</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> data)00138 {00139     <span class="comment">// print 4-bit hex value</span>00140 <span class="comment">//  char Character = data&amp;0x0f;</span>00141 <span class="comment">//  if (Character&gt;9)</span>00142 <span class="comment">//      Character+='A'-10;</span>00143 <span class="comment">//  else</span>00144 <span class="comment">//      Character+='0';</span>00145     <a class="code" href="rprintf_8h.html#a7">rprintfChar</a>(PRG_RDB( HexChars+(data&amp;0x0f) ));00146 }00147 00148 <span class="comment">// *** rprintfu08 ***</span>00149 <span class="comment">// prints an unsigned 8-bit number in hex (2 digits)</span><a name="l00150"></a><a class="code" href="rprintf_8h.html#a13">00150</a> <span class="keywordtype">void</span> <a class="code" href="rprintf_8h.html#a13">rprintfu08</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> data)00151 {00152     <span class="comment">// print 8-bit hex value</span>00153     <a class="code" href="rprintf_8h.html#a12">rprintfu04</a>(data&gt;&gt;4);00154     <a class="code" href="rprintf_8h.html#a12">rprintfu04</a>(data);00155 }00156 00157 <span class="comment">// *** rprintfu16 ***</span>00158 <span class="comment">// prints an unsigned 16-bit number in hex (4 digits)</span><a name="l00159"></a><a class="code" href="rprintf_8h.html#a14">00159</a> <span class="keywordtype">void</span> <a class="code" href="rprintf_8h.html#a14">rprintfu16</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> data)00160 {00161     <span class="comment">// print 16-bit hex value</span>00162     <a class="code" href="rprintf_8h.html#a13">rprintfu08</a>(data&gt;&gt;8);00163     <a class="code" href="rprintf_8h.html#a13">rprintfu08</a>(data);00164 }00165 00166 <span class="comment">// *** rprintfu32 ***</span>00167 <span class="comment">// prints an unsigned 32-bit number in hex (8 digits)</span><a name="l00168"></a><a class="code" href="rprintf_8h.html#a15">00168</a> <span class="keywordtype">void</span> <a class="code" href="rprintf_8h.html#a15">rprintfu32</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> data)00169 {00170     <span class="comment">// print 32-bit hex value</span>00171     <a class="code" href="rprintf_8h.html#a14">rprintfu16</a>(data&gt;&gt;16);00172     <a class="code" href="rprintf_8h.html#a14">rprintfu16</a>(data);00173 }00174 00175 <span class="comment">// *** rprintfNum ***</span>00176 <span class="comment">// special printf for numbers only</span>00177 <span class="comment">// see formatting information below</span>00178 <span class="comment">//  Print the number "n" in the given "base"</span>00179 <span class="comment">//  using exactly "numDigits"</span>00180 <span class="comment">//  print +/- if signed flag "isSigned" is TRUE</span>00181 <span class="comment">//  use the character specified in "padchar" to pad extra characters</span>00182 <span class="comment">//</span>00183 <span class="comment">//  Examples:</span>00184 <span class="comment">//  uartPrintfNum(10, 6,  TRUE, ' ',   1234);  --&gt;  " +1234"</span>00185 <span class="comment">//  uartPrintfNum(10, 6, FALSE, '0',   1234);  --&gt;  "001234"</span>00186 <span class="comment">//  uartPrintfNum(16, 6, FALSE, '.', 0x5AA5);  --&gt;  "..5AA5"</span><a name="l00187"></a><a class="code" href="rprintf_8h.html#a16">00187</a> <span class="keywordtype">void</span> <a class="code" href="rprintf_8h.html#a16">rprintfNum</a>(<span class="keywordtype">char</span> base, <span class="keywordtype">char</span> numDigits, <span class="keywordtype">char</span> isSigned, <span class="keywordtype">char</span> padchar, <span class="keywordtype">long</span> n)00188 {00189     <span class="comment">// define a global HexChars or use line below</span>00190     <span class="comment">//static char HexChars[16] = "0123456789ABCDEF";</span>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产欧美亚州国产日韩mv天天看完整| 在线视频你懂得一区二区三区| 亚洲欧美视频在线观看视频| 久久婷婷色综合| 欧美三级资源在线| 成人网男人的天堂| 九色|91porny| 亚洲一区二区3| 亚洲国产精品国自产拍av| 欧美一级日韩免费不卡| av资源网一区| 韩日av一区二区| 婷婷一区二区三区| 成人免费在线视频| 国产亚洲欧美日韩日本| 欧美精三区欧美精三区| 99久久99久久久精品齐齐| 国产一区二区三区久久久 | 欧美色图天堂网| 九色综合国产一区二区三区| 亚洲chinese男男1069| 一区二区视频在线| 国产精品私房写真福利视频| 国产亚洲精品7777| www亚洲一区| 亚洲精品一区二区三区在线观看| 欧美日韩免费观看一区三区| 在线观看亚洲专区| 国产大陆精品国产| 国产精品123| 午夜激情综合网| 香蕉影视欧美成人| 免费不卡在线观看| 国产高清一区日本| 91丨porny丨国产入口| 在线欧美日韩精品| 欧美专区在线观看一区| 欧美日韩日日摸| 日韩欧美一级二级三级久久久| 91精品国产麻豆国产自产在线 | 国产美女娇喘av呻吟久久| 久久精品国产亚洲一区二区三区 | 精品一区二区三区日韩| 国产凹凸在线观看一区二区| 色妞www精品视频| 在线亚洲一区二区| 91精品在线一区二区| 国产日韩欧美a| 日韩视频一区二区| 亚洲人成网站在线| 日本成人在线视频网站| 波多野结衣精品在线| 欧美一区二区视频网站| 综合色中文字幕| 日本aⅴ免费视频一区二区三区 | 青青国产91久久久久久| 成人av网站免费| 日韩视频免费观看高清在线视频| 国产精品婷婷午夜在线观看| 亚洲一区在线视频| 91香蕉视频污在线| 久久老女人爱爱| 秋霞影院一区二区| 91国在线观看| 亚洲国产高清不卡| 国内精品久久久久影院薰衣草 | 男女视频一区二区| 色婷婷精品大在线视频| 久久精品一级爱片| 国产高清在线观看免费不卡| 国产日韩欧美高清| 成人理论电影网| 久久99精品国产| 久久久精品免费观看| 国产精品一区专区| 国产精品理伦片| 欧美怡红院视频| 日本三级韩国三级欧美三级| 国产日韩欧美精品一区| 国产永久精品大片wwwapp| 91精品久久久久久蜜臀| 亚洲成a人片在线不卡一二三区| 欧美性色黄大片手机版| 亚洲国产精品久久久男人的天堂| 欧美四级电影网| 日韩专区在线视频| 精品久久人人做人人爰| 国产精品一区二区不卡| 亚洲欧美另类小说| 欧美日韩国产成人在线免费| 日韩二区在线观看| 日本一区免费视频| 欧洲一区二区av| 激情五月播播久久久精品| 国产精品国产三级国产专播品爱网| 色久优优欧美色久优优| 日韩不卡一区二区三区| 久久久久99精品国产片| 在线看国产日韩| 日韩电影一二三区| 国产婷婷一区二区| 欧美老肥妇做.爰bbww视频| 黄色日韩三级电影| 亚洲高清免费视频| 久久亚洲捆绑美女| 日韩视频一区在线观看| 不卡的av在线播放| 国产麻豆午夜三级精品| 一个色综合av| 久久久www成人免费无遮挡大片| 99这里都是精品| 日韩av不卡在线观看| 亚洲欧美国产毛片在线| 久久久综合网站| 欧美一区二区三区的| 日本道免费精品一区二区三区| 国产精品中文字幕日韩精品| 久久99久久久欧美国产| 国产精品国产三级国产aⅴ中文 | 久久99久久精品| 天天综合色天天| 亚洲午夜久久久久久久久电影院 | 国产高清在线精品| 国模大尺度一区二区三区| 视频一区视频二区中文字幕| 伊人一区二区三区| 亚洲欧美区自拍先锋| 久久久99免费| 国产女同互慰高潮91漫画| 精品99999| 国产欧美日韩一区二区三区在线观看| 欧美年轻男男videosbes| 91免费在线播放| 色综合咪咪久久| 欧美自拍丝袜亚洲| 欧美日韩成人在线一区| 91麻豆精品国产自产在线观看一区| 欧美在线免费视屏| 欧美在线不卡一区| 欧美日韩国产综合一区二区| 91精品国产综合久久精品性色| 欧美高清hd18日本| 日韩美女天天操| 国产精品美女久久福利网站| 亚洲特黄一级片| 一区二区三区在线观看网站| 午夜精品久久久久久久久久久 | 欧美巨大另类极品videosbest | 精品国产91久久久久久久妲己| 国产精品美日韩| 成人在线视频一区二区| 国产精品免费人成网站| 91在线免费视频观看| 欧美一区二区人人喊爽| 国产精品传媒在线| 久久99这里只有精品| 欧美猛男男办公室激情| 中文字幕中文字幕在线一区 | 国产精品亚洲综合一区在线观看| 欧美人伦禁忌dvd放荡欲情| 亚洲日本护士毛茸茸| 岛国精品一区二区| 欧美xxxx在线观看| 日本三级亚洲精品| 日韩精品一区二区三区四区| 美女尤物国产一区| 久久久亚洲国产美女国产盗摄 | 欧美精品一区视频| 免费精品视频在线| 亚洲精品一区二区三区精华液| 青青草伊人久久| 精品精品欲导航| 国产精品乡下勾搭老头1| 国产农村妇女精品| 99国产欧美久久久精品| 亚洲精品va在线观看| 制服丝袜亚洲播放| 国产91丝袜在线播放九色| 日韩理论片在线| 欧美一二三四区在线| 国产一区二区三区在线看麻豆| 欧美午夜精品免费| 国产精品三级av| 欧美一区二区在线免费播放| 99久久精品国产精品久久| 国产不卡免费视频| 精品一二线国产| 亚洲最新视频在线播放| 这里只有精品免费| 91麻豆免费观看| 国产精品主播直播| 另类小说一区二区三区| 一区二区三区四区视频精品免费 | 5566中文字幕一区二区电影| 国产精品一区免费在线观看| 日本不卡一区二区| 一区二区三区四区国产精品| 中文字幕第一区综合| 欧美草草影院在线视频| 色一区在线观看|