mirror of https://github.com/ArduPilot/ardupilot
94 lines
5.9 KiB
HTML
94 lines
5.9 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<title>ArduPilot Libraries: BetterStream.cpp Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javaScript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body onload='searchBox.OnSelectItem(0);'>
|
|
<!-- Generated by Doxygen 1.7.1 -->
|
|
<div class="navigation" id="top">
|
|
<div class="tabs">
|
|
<ul class="tablist">
|
|
<li><a href="main.html"><span>Main Page</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="tabs2">
|
|
<ul class="tablist">
|
|
<li><a href="files.html"><span>File List</span></a></li>
|
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<h1>BetterStream.cpp</h1> </div>
|
|
</div>
|
|
<div class="contents">
|
|
<a href="_better_stream_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- Mode: C++; c-basic-offset: 8; indent-tabs-mode: nil -*-</span>
|
|
<a name="l00002"></a>00002 <span class="comment">//</span>
|
|
<a name="l00003"></a>00003 <span class="comment">// Copyright (c) 2010 Michael Smith. All rights reserved.</span>
|
|
<a name="l00004"></a>00004 <span class="comment">//</span>
|
|
<a name="l00005"></a>00005 <span class="comment">// This is free software; you can redistribute it and/or modify it under</span>
|
|
<a name="l00006"></a>00006 <span class="comment">// the terms of the GNU Lesser General Public License as published by the</span>
|
|
<a name="l00007"></a>00007 <span class="comment">// Free Software Foundation; either version 2.1 of the License, or (at</span>
|
|
<a name="l00008"></a>00008 <span class="comment">// your option) any later version.</span>
|
|
<a name="l00009"></a>00009 <span class="comment">//</span>
|
|
<a name="l00010"></a>00010
|
|
<a name="l00011"></a>00011 <span class="comment">//</span>
|
|
<a name="l00012"></a>00012 <span class="comment">// Enhancements to the Arduino Stream class.</span>
|
|
<a name="l00013"></a>00013 <span class="comment">//</span>
|
|
<a name="l00014"></a>00014
|
|
<a name="l00015"></a>00015 <span class="preprocessor">#include "<a class="code" href="_better_stream_8h.html">BetterStream.h</a>"</span>
|
|
<a name="l00016"></a>00016
|
|
<a name="l00017"></a>00017 <span class="comment">// Stream extensions////////////////////////////////////////////////////////////</span>
|
|
<a name="l00018"></a>00018
|
|
<a name="l00019"></a>00019 <span class="keywordtype">void</span>
|
|
<a name="l00020"></a>00020 <a class="code" href="class_better_stream.html#a0016dc539b93bf6856120604958114a0">BetterStream::print_P</a>(<span class="keyword">const</span> prog_char *s)
|
|
<a name="l00021"></a>00021 {
|
|
<a name="l00022"></a>00022 <span class="keywordtype">char</span> c;
|
|
<a name="l00023"></a>00023
|
|
<a name="l00024"></a>00024 <span class="keywordflow">while</span> (<span class="charliteral">'\0'</span> != (c = pgm_read_byte(s++)))
|
|
<a name="l00025"></a>00025 <a class="code" href="class_stream.html#a46cd2d80c276134f30300d619416d5c8">write</a>(c);
|
|
<a name="l00026"></a>00026 }
|
|
<a name="l00027"></a>00027
|
|
<a name="l00028"></a>00028 <span class="keywordtype">void</span>
|
|
<a name="l00029"></a><a class="code" href="class_better_stream.html#a6aac449cc793106cd8f78ea6934ae002">00029</a> <a class="code" href="class_better_stream.html#a6aac449cc793106cd8f78ea6934ae002">BetterStream::println_P</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *s)
|
|
<a name="l00030"></a>00030 {
|
|
<a name="l00031"></a>00031 <a class="code" href="class_better_stream.html#a0016dc539b93bf6856120604958114a0">print_P</a>(s);
|
|
<a name="l00032"></a>00032 println();
|
|
<a name="l00033"></a>00033 }
|
|
<a name="l00034"></a>00034
|
|
<a name="l00035"></a>00035 <span class="keywordtype">void</span>
|
|
<a name="l00036"></a><a class="code" href="class_better_stream.html#aa735777635173dca53f4d9a4f6a1e0b8">00036</a> <a class="code" href="class_better_stream.html#aa735777635173dca53f4d9a4f6a1e0b8">BetterStream::printf</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, ...)
|
|
<a name="l00037"></a>00037 {
|
|
<a name="l00038"></a>00038 va_list ap;
|
|
<a name="l00039"></a>00039
|
|
<a name="l00040"></a>00040 va_start(ap, fmt);
|
|
<a name="l00041"></a>00041 _vprintf(0, fmt, ap);
|
|
<a name="l00042"></a>00042 va_end(ap);
|
|
<a name="l00043"></a>00043 }
|
|
<a name="l00044"></a>00044
|
|
<a name="l00045"></a>00045 <span class="keywordtype">void</span>
|
|
<a name="l00046"></a><a class="code" href="class_better_stream.html#a53ea8468145fd16a3a137002b87040ad">00046</a> <a class="code" href="class_better_stream.html#a53ea8468145fd16a3a137002b87040ad">BetterStream::printf_P</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, ...)
|
|
<a name="l00047"></a>00047 {
|
|
<a name="l00048"></a>00048 va_list ap;
|
|
<a name="l00049"></a>00049
|
|
<a name="l00050"></a>00050 va_start(ap, fmt);
|
|
<a name="l00051"></a>00051 _vprintf(1, fmt, ap);
|
|
<a name="l00052"></a>00052 va_end(ap);
|
|
<a name="l00053"></a>00053 }
|
|
<a name="l00054"></a>00054
|
|
</pre></div></div>
|
|
</div>
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated for ArduPilot Libraries by <a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
|
|
</body>
|
|
</html>
|