\doxysection{SEGGER\+\_\+\+RTT.\+c}
\hypertarget{_s_e_g_g_e_r___r_t_t_8c_source}{}\label{_s_e_g_g_e_r___r_t_t_8c_source}\index{E:/.WORK/STM32/STM\_Libs/STM32\_ExtendedLibs/RTT/SEGGER\_RTT.c@{E:/.WORK/STM32/STM\_Libs/STM32\_ExtendedLibs/RTT/SEGGER\_RTT.c}}

\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00001}00001\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00002}00002\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ SEGGER\ Microcontroller\ GmbH\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00003}00003\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ The\ Embedded\ Experts\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00004}00004\ \textcolor{comment}{**********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00005}00005\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00006}00006\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ (c)\ 1995\ -\/\ 2021\ SEGGER\ Microcontroller\ GmbH\ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00007}00007\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00008}00008\ \textcolor{comment}{*\ \ \ \ \ \ \ www.segger.com\ \ \ \ \ Support:\ support@segger.com\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00009}00009\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00010}00010\ \textcolor{comment}{**********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00011}00011\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00012}00012\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\ RTT\ *\ Real\ Time\ Transfer\ for\ embedded\ targets\ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00013}00013\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00014}00014\ \textcolor{comment}{**********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00015}00015\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00016}00016\ \textcolor{comment}{*\ All\ rights\ reserved.\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00017}00017\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00018}00018\ \textcolor{comment}{*\ SEGGER\ strongly\ recommends\ to\ not\ make\ any\ changes\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00019}00019\ \textcolor{comment}{*\ to\ or\ modify\ the\ source\ code\ of\ this\ software\ in\ order\ to\ stay\ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00020}00020\ \textcolor{comment}{*\ compatible\ with\ the\ RTT\ protocol\ and\ J-\/Link.\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00021}00021\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00022}00022\ \textcolor{comment}{*\ Redistribution\ and\ use\ in\ source\ and\ binary\ forms,\ with\ or\ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00023}00023\ \textcolor{comment}{*\ without\ modification,\ are\ permitted\ provided\ that\ the\ following\ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00024}00024\ \textcolor{comment}{*\ condition\ is\ met:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00025}00025\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00026}00026\ \textcolor{comment}{*\ o\ Redistributions\ of\ source\ code\ must\ retain\ the\ above\ copyright\ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00027}00027\ \textcolor{comment}{*\ \ \ notice,\ this\ condition\ and\ the\ following\ disclaimer.\ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00028}00028\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00029}00029\ \textcolor{comment}{*\ THIS\ SOFTWARE\ IS\ PROVIDED\ BY\ THE\ COPYRIGHT\ HOLDERS\ AND\ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00030}00030\ \textcolor{comment}{*\ CONTRIBUTORS\ "{}AS\ IS"{}\ AND\ ANY\ EXPRESS\ OR\ IMPLIED\ WARRANTIES,\ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00031}00031\ \textcolor{comment}{*\ INCLUDING,\ BUT\ NOT\ LIMITED\ TO,\ THE\ IMPLIED\ WARRANTIES\ OF\ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00032}00032\ \textcolor{comment}{*\ MERCHANTABILITY\ AND\ FITNESS\ FOR\ A\ PARTICULAR\ PURPOSE\ ARE\ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00033}00033\ \textcolor{comment}{*\ DISCLAIMED.\ IN\ NO\ EVENT\ SHALL\ SEGGER\ Microcontroller\ BE\ LIABLE\ FOR\ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00034}00034\ \textcolor{comment}{*\ ANY\ DIRECT,\ INDIRECT,\ INCIDENTAL,\ SPECIAL,\ EXEMPLARY,\ OR\ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00035}00035\ \textcolor{comment}{*\ CONSEQUENTIAL\ DAMAGES\ (INCLUDING,\ BUT\ NOT\ LIMITED\ TO,\ PROCUREMENT\ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00036}00036\ \textcolor{comment}{*\ OF\ SUBSTITUTE\ GOODS\ OR\ SERVICES;\ LOSS\ OF\ USE,\ DATA,\ OR\ PROFITS;\ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00037}00037\ \textcolor{comment}{*\ OR\ BUSINESS\ INTERRUPTION)\ HOWEVER\ CAUSED\ AND\ ON\ ANY\ THEORY\ OF\ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00038}00038\ \textcolor{comment}{*\ LIABILITY,\ WHETHER\ IN\ CONTRACT,\ STRICT\ LIABILITY,\ OR\ TORT\ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00039}00039\ \textcolor{comment}{*\ (INCLUDING\ NEGLIGENCE\ OR\ OTHERWISE)\ ARISING\ IN\ ANY\ WAY\ OUT\ OF\ THE\ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00040}00040\ \textcolor{comment}{*\ USE\ OF\ THIS\ SOFTWARE,\ EVEN\ IF\ ADVISED\ OF\ THE\ POSSIBILITY\ OF\ SUCH\ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00041}00041\ \textcolor{comment}{*\ DAMAGE.\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00042}00042\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00043}00043\ \textcolor{comment}{**********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00044}00044\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00045}00045\ \textcolor{comment}{*\ \ \ \ \ \ \ RTT\ version:\ 8.10g\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00046}00046\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00047}00047\ \textcolor{comment}{**********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00048}00048\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00049}00049\ \textcolor{comment}{-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/END-\/OF-\/HEADER-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00050}00050\ \textcolor{comment}{File\ \ \ \ :\ SEGGER\_RTT.c}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00051}00051\ \textcolor{comment}{Purpose\ :\ Implementation\ of\ SEGGER\ real-\/time\ transfer\ (RTT)\ which}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00052}00052\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ allows\ real-\/time\ communication\ on\ targets\ which\ support}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00053}00053\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ debugger\ memory\ accesses\ while\ the\ CPU\ is\ running.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00054}00054\ \textcolor{comment}{Revision:\ \$Rev:\ 29668\ \$}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00055}00055\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00056}00056\ \textcolor{comment}{Additional\ information:}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00057}00057\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ Type\ "{}int"{}\ is\ assumed\ to\ be\ 32-\/bits\ in\ size}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00058}00058\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ H-\/>T\ \ \ \ Host\ to\ target\ communication}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00059}00059\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ T-\/>H\ \ \ \ Target\ to\ host\ communication}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00060}00060\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00061}00061\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ RTT\ channel\ 0\ is\ always\ present\ and\ reserved\ for\ Terminal\ usage.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00062}00062\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ Name\ is\ fixed\ to\ "{}Terminal"{}}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00063}00063\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00064}00064\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ Effective\ buffer\ size:\ SizeOfBuffer\ -\/\ 1}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00065}00065\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00066}00066\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ WrOff\ ==\ RdOff:\ \ \ \ \ \ \ Buffer\ is\ empty}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00067}00067\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ WrOff\ ==\ (RdOff\ -\/\ 1):\ Buffer\ is\ full}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00068}00068\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ WrOff\ >\ \ RdOff:\ \ \ \ \ \ \ Free\ space\ includes\ wrap-\/around}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00069}00069\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ WrOff\ <\ \ RdOff:\ \ \ \ \ \ \ Used\ space\ includes\ wrap-\/around}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00070}00070\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ (WrOff\ ==\ (SizeOfBuffer\ -\/\ 1))\ \&\&\ (RdOff\ ==\ 0):}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00071}00071\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Buffer\ full\ and\ wrap-\/around\ after\ next\ byte}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00072}00072\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00073}00073\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00074}00074\ \textcolor{comment}{-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00075}00075\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00076}00076\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00077}00077\ \textcolor{preprocessor}{\#include\ "{}SEGGER\_RTT.h"{}}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00078}00078\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00079}00079\ \textcolor{preprocessor}{\#include\ <string.h>}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ for\ memcpy}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00080}00080\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00081}00081\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00082}00082\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00083}00083\ \textcolor{comment}{*\ \ \ \ \ \ \ Configuration,\ default\ values}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00084}00084\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00085}00085\ \textcolor{comment}{**********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00086}00086\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00087}00087\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00088}00088\ \textcolor{preprocessor}{\#if\ SEGGER\_RTT\_CPU\_CACHE\_LINE\_SIZE}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00089}00089\ \textcolor{preprocessor}{\ \ \#ifdef\ SEGGER\_RTT\_CB\_ALIGN}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00090}00090\ \textcolor{preprocessor}{\ \ \ \ \#error\ "{}Custom\ SEGGER\_RTT\_CB\_ALIGN()\ is\ not\ supported\ for\ SEGGER\_RTT\_CPU\_CACHE\_LINE\_SIZE\ !=\ 0"{}}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00091}00091\ \textcolor{preprocessor}{\ \ \#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00092}00092\ \textcolor{preprocessor}{\ \ \#ifdef\ SEGGER\_RTT\_BUFFER\_ALIGN}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00093}00093\ \textcolor{preprocessor}{\ \ \ \ \#error\ "{}Custom\ SEGGER\_RTT\_BUFFER\_ALIGN()\ is\ not\ supported\ for\ SEGGER\_RTT\_CPU\_CACHE\_LINE\_SIZE\ !=\ 0"{}}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00094}00094\ \textcolor{preprocessor}{\ \ \#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00095}00095\ \textcolor{preprocessor}{\ \ \#ifdef\ SEGGER\_RTT\_PUT\_CB\_SECTION}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00096}00096\ \textcolor{preprocessor}{\ \ \ \ \#error\ "{}Custom\ SEGGER\_RTT\_PUT\_CB\_SECTION()\ is\ not\ supported\ for\ SEGGER\_RTT\_CPU\_CACHE\_LINE\_SIZE\ !=\ 0"{}}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00097}00097\ \textcolor{preprocessor}{\ \ \#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00098}00098\ \textcolor{preprocessor}{\ \ \#ifdef\ SEGGER\_RTT\_PUT\_BUFFER\_SECTION}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00099}00099\ \textcolor{preprocessor}{\ \ \ \ \#error\ "{}Custom\ SEGGER\_RTT\_PUT\_BUFFER\_SECTION()\ is\ not\ supported\ for\ SEGGER\_RTT\_CPU\_CACHE\_LINE\_SIZE\ !=\ 0"{}}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00100}00100\ \textcolor{preprocessor}{\ \ \#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00101}00101\ \textcolor{preprocessor}{\ \ \#ifdef\ SEGGER\_RTT\_BUFFER\_ALIGNMENT}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00102}00102\ \textcolor{preprocessor}{\ \ \ \ \#error\ "{}Custom\ SEGGER\_RTT\_BUFFER\_ALIGNMENT\ is\ not\ supported\ for\ SEGGER\_RTT\_CPU\_CACHE\_LINE\_SIZE\ !=\ 0"{}}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00103}00103\ \textcolor{preprocessor}{\ \ \#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00104}00104\ \textcolor{preprocessor}{\ \ \#ifdef\ SEGGER\_RTT\_ALIGNMENT}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00105}00105\ \textcolor{preprocessor}{\ \ \ \ \#error\ "{}Custom\ SEGGER\_RTT\_ALIGNMENT\ is\ not\ supported\ for\ SEGGER\_RTT\_CPU\_CACHE\_LINE\_SIZE\ !=\ 0"{}}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00106}00106\ \textcolor{preprocessor}{\ \ \#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00107}00107\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00108}00108\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00109}00109\ \textcolor{preprocessor}{\#ifndef\ \ \ BUFFER\_SIZE\_UP}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00110}00110\ \textcolor{preprocessor}{\ \ \#define\ BUFFER\_SIZE\_UP\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 1024\ \ }\textcolor{comment}{//\ Size\ of\ the\ buffer\ for\ terminal\ output\ of\ target,\ up\ to\ host}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00111}00111\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00112}00112\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00113}00113\ \textcolor{preprocessor}{\#ifndef\ \ \ BUFFER\_SIZE\_DOWN}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00114}00114\ \textcolor{preprocessor}{\ \ \#define\ BUFFER\_SIZE\_DOWN\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 16\ \ \ \ }\textcolor{comment}{//\ Size\ of\ the\ buffer\ for\ terminal\ input\ to\ target\ from\ host\ (Usually\ keyboard\ input)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00115}00115\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00116}00116\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00117}00117\ \textcolor{preprocessor}{\#ifndef\ \ \ SEGGER\_RTT\_MAX\_NUM\_UP\_BUFFERS}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00118}00118\ \textcolor{preprocessor}{\ \ \#define\ SEGGER\_RTT\_MAX\_NUM\_UP\_BUFFERS\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 2\ \ \ \ }\textcolor{comment}{//\ Number\ of\ up-\/buffers\ (T-\/>H)\ available\ on\ this\ target}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00119}00119\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00120}00120\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00121}00121\ \textcolor{preprocessor}{\#ifndef\ \ \ SEGGER\_RTT\_MAX\_NUM\_DOWN\_BUFFERS}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00122}00122\ \textcolor{preprocessor}{\ \ \#define\ SEGGER\_RTT\_MAX\_NUM\_DOWN\_BUFFERS\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 2\ \ \ \ }\textcolor{comment}{//\ Number\ of\ down-\/buffers\ (H-\/>T)\ available\ on\ this\ target}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00123}00123\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00124}00124\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00125}00125\ \textcolor{preprocessor}{\#ifndef\ SEGGER\_RTT\_BUFFER\_SECTION}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00126}00126\ \textcolor{preprocessor}{\ \ \#if\ defined(SEGGER\_RTT\_SECTION)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00127}00127\ \textcolor{preprocessor}{\ \ \ \ \#define\ SEGGER\_RTT\_BUFFER\_SECTION\ SEGGER\_RTT\_SECTION}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00128}00128\ \textcolor{preprocessor}{\ \ \#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00129}00129\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00130}00130\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00131}00131\ \textcolor{preprocessor}{\#ifndef\ \ \ SEGGER\_RTT\_ALIGNMENT}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00132}00132\ \textcolor{preprocessor}{\ \ \#define\ SEGGER\_RTT\_ALIGNMENT\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ SEGGER\_RTT\_CPU\_CACHE\_LINE\_SIZE}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00133}00133\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00134}00134\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00135}00135\ \textcolor{preprocessor}{\#ifndef\ \ \ SEGGER\_RTT\_BUFFER\_ALIGNMENT}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00136}00136\ \textcolor{preprocessor}{\ \ \#define\ SEGGER\_RTT\_BUFFER\_ALIGNMENT\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ SEGGER\_RTT\_CPU\_CACHE\_LINE\_SIZE}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00137}00137\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00138}00138\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00139}00139\ \textcolor{preprocessor}{\#ifndef\ \ \ SEGGER\_RTT\_MODE\_DEFAULT}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00140}00140\ \textcolor{preprocessor}{\ \ \#define\ SEGGER\_RTT\_MODE\_DEFAULT\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ SEGGER\_RTT\_MODE\_NO\_BLOCK\_SKIP}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00141}00141\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00142}00142\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00143}00143\ \textcolor{preprocessor}{\#ifndef\ \ \ SEGGER\_RTT\_LOCK}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00144}00144\ \textcolor{preprocessor}{\ \ \#define\ SEGGER\_RTT\_LOCK()}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00145}00145\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00146}00146\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00147}00147\ \textcolor{preprocessor}{\#ifndef\ \ \ SEGGER\_RTT\_UNLOCK}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00148}00148\ \textcolor{preprocessor}{\ \ \#define\ SEGGER\_RTT\_UNLOCK()}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00149}00149\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00150}00150\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00151}00151\ \textcolor{preprocessor}{\#ifndef\ \ \ STRLEN}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00152}00152\ \textcolor{preprocessor}{\ \ \#define\ STRLEN(a)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ strlen((a))}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00153}00153\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00154}00154\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00155}00155\ \textcolor{preprocessor}{\#ifndef\ \ \ STRCPY}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00156}00156\ \textcolor{preprocessor}{\ \ \#define\ STRCPY(pDest,\ pSrc)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ strcpy((pDest),\ (pSrc))}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00157}00157\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00158}00158\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00159}00159\ \textcolor{preprocessor}{\#ifndef\ \ \ SEGGER\_RTT\_MEMCPY\_USE\_BYTELOOP}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00160}00160\ \textcolor{preprocessor}{\ \ \#define\ SEGGER\_RTT\_MEMCPY\_USE\_BYTELOOP\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00161}00161\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00162}00162\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00163}00163\ \textcolor{preprocessor}{\#ifndef\ \ \ SEGGER\_RTT\_MEMCPY}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00164}00164\ \textcolor{preprocessor}{\ \ \#ifdef\ \ MEMCPY}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00165}00165\ \textcolor{preprocessor}{\ \ \ \ \#define\ SEGGER\_RTT\_MEMCPY(pDest,\ pSrc,\ NumBytes)\ \ \ \ \ \ MEMCPY((pDest),\ (pSrc),\ (NumBytes))}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00166}00166\ \textcolor{preprocessor}{\ \ \#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00167}00167\ \textcolor{preprocessor}{\ \ \ \ \#define\ SEGGER\_RTT\_MEMCPY(pDest,\ pSrc,\ NumBytes)\ \ \ \ \ \ memcpy((pDest),\ (pSrc),\ (NumBytes))}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00168}00168\ \textcolor{preprocessor}{\ \ \#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00169}00169\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00170}00170\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00171}00171\ \textcolor{preprocessor}{\#ifndef\ \ \ MIN}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00172}00172\ \textcolor{preprocessor}{\ \ \#define\ MIN(a,\ b)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (((a)\ <\ (b))\ ?\ (a)\ :\ (b))}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00173}00173\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00174}00174\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00175}00175\ \textcolor{preprocessor}{\#ifndef\ \ \ MAX}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00176}00176\ \textcolor{preprocessor}{\ \ \#define\ MAX(a,\ b)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (((a)\ >\ (b))\ ?\ (a)\ :\ (b))}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00177}00177\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00178}00178\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00179}00179\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00180}00180\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00181}00181\ \textcolor{comment}{*\ \ \ \ \ \ \ Defines,\ fixed}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00182}00182\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00183}00183\ \textcolor{comment}{**********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00184}00184\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00185}00185\ \textcolor{preprocessor}{\#if\ (defined\ \_\_ICCARM\_\_)\ ||\ (defined\ \_\_ICCRX\_\_)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00186}00186\ \textcolor{preprocessor}{\ \ \#define\ RTT\_PRAGMA(P)\ \_Pragma(\#P)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00187}00187\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00188}00188\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00189}00189\ \textcolor{preprocessor}{\#if\ SEGGER\_RTT\_ALIGNMENT\ ||\ SEGGER\_RTT\_BUFFER\_ALIGNMENT}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00190}00190\ \textcolor{preprocessor}{\ \ \#if\ ((defined\ \_\_GNUC\_\_)\ ||\ (defined\ \_\_clang\_\_))}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00191}00191\ \textcolor{preprocessor}{\ \ \ \ \#define\ SEGGER\_RTT\_ALIGN(Var,\ Alignment)\ Var\ \_\_attribute\_\_\ ((aligned\ (Alignment)))}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00192}00192\ \textcolor{preprocessor}{\ \ \#elif\ (defined\ \_\_ICCARM\_\_)\ ||\ (defined\ \_\_ICCRX\_\_)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00193}00193\ \textcolor{preprocessor}{\ \ \ \ \#define\ PRAGMA(A)\ \_Pragma(\#A)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00194}00194\ \textcolor{preprocessor}{\#define\ SEGGER\_RTT\_ALIGN(Var,\ Alignment)\ RTT\_PRAGMA(data\_alignment=Alignment)\ \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00195}00195\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Var}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00196}00196\ \textcolor{preprocessor}{\ \ \#elif\ (defined\ \_\_CC\_ARM)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00197}00197\ \textcolor{preprocessor}{\ \ \ \ \#define\ SEGGER\_RTT\_ALIGN(Var,\ Alignment)\ Var\ \_\_attribute\_\_\ ((aligned\ (Alignment)))}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00198}00198\ \textcolor{preprocessor}{\ \ \#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00199}00199\ \textcolor{preprocessor}{\ \ \ \ \#error\ "{}Alignment\ not\ supported\ for\ this\ compiler."{}}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00200}00200\ \textcolor{preprocessor}{\ \ \#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00201}00201\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00202}00202\ \textcolor{preprocessor}{\ \ \#define\ SEGGER\_RTT\_ALIGN(Var,\ Alignment)\ Var}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00203}00203\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00204}00204\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00205}00205\ \textcolor{preprocessor}{\#if\ defined(SEGGER\_RTT\_SECTION)\ ||\ defined\ (SEGGER\_RTT\_BUFFER\_SECTION)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00206}00206\ \textcolor{preprocessor}{\ \ \#if\ ((defined\ \_\_GNUC\_\_)\ ||\ (defined\ \_\_clang\_\_))}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00207}00207\ \textcolor{preprocessor}{\ \ \ \ \#define\ SEGGER\_RTT\_PUT\_SECTION(Var,\ Section)\ \_\_attribute\_\_\ ((section\ (Section)))\ Var}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00208}00208\ \textcolor{preprocessor}{\ \ \#elif\ (defined\ \_\_ICCARM\_\_)\ ||\ (defined\ \_\_ICCRX\_\_)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00209}00209\ \textcolor{preprocessor}{\#define\ SEGGER\_RTT\_PUT\_SECTION(Var,\ Section)\ RTT\_PRAGMA(location=Section)\ \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00210}00210\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Var}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00211}00211\ \textcolor{preprocessor}{\ \ \#elif\ (defined\ \_\_CC\_ARM)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00212}00212\ \textcolor{preprocessor}{\ \ \ \ \#define\ SEGGER\_RTT\_PUT\_SECTION(Var,\ Section)\ \_\_attribute\_\_\ ((section\ (Section),\ zero\_init))\ \ Var}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00213}00213\ \textcolor{preprocessor}{\ \ \#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00214}00214\ \textcolor{preprocessor}{\ \ \ \ \#error\ "{}Section\ placement\ not\ supported\ for\ this\ compiler."{}}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00215}00215\ \textcolor{preprocessor}{\ \ \#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00216}00216\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00217}00217\ \textcolor{preprocessor}{\ \ \#define\ SEGGER\_RTT\_PUT\_SECTION(Var,\ Section)\ Var}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00218}00218\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00219}00219\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00220}00220\ \textcolor{preprocessor}{\#if\ SEGGER\_RTT\_ALIGNMENT}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00221}00221\ \textcolor{preprocessor}{\ \ \#define\ SEGGER\_RTT\_CB\_ALIGN(Var)\ \ SEGGER\_RTT\_ALIGN(Var,\ SEGGER\_RTT\_ALIGNMENT)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00222}00222\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00223}00223\ \textcolor{preprocessor}{\ \ \#define\ SEGGER\_RTT\_CB\_ALIGN(Var)\ \ Var}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00224}00224\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00225}00225\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00226}00226\ \textcolor{preprocessor}{\#if\ SEGGER\_RTT\_BUFFER\_ALIGNMENT}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00227}00227\ \textcolor{preprocessor}{\ \ \#define\ SEGGER\_RTT\_BUFFER\_ALIGN(Var)\ \ SEGGER\_RTT\_ALIGN(Var,\ SEGGER\_RTT\_BUFFER\_ALIGNMENT)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00228}00228\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00229}00229\ \textcolor{preprocessor}{\ \ \#define\ SEGGER\_RTT\_BUFFER\_ALIGN(Var)\ \ Var}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00230}00230\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00231}00231\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00232}00232\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00233}00233\ \textcolor{preprocessor}{\#if\ defined(SEGGER\_RTT\_SECTION)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00234}00234\ \textcolor{preprocessor}{\ \ \#define\ SEGGER\_RTT\_PUT\_CB\_SECTION(Var)\ SEGGER\_RTT\_PUT\_SECTION(Var,\ SEGGER\_RTT\_SECTION)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00235}00235\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00236}00236\ \textcolor{preprocessor}{\ \ \#define\ SEGGER\_RTT\_PUT\_CB\_SECTION(Var)\ Var}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00237}00237\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00238}00238\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00239}00239\ \textcolor{preprocessor}{\#if\ defined(SEGGER\_RTT\_BUFFER\_SECTION)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00240}00240\ \textcolor{preprocessor}{\ \ \#define\ SEGGER\_RTT\_PUT\_BUFFER\_SECTION(Var)\ SEGGER\_RTT\_PUT\_SECTION(Var,\ SEGGER\_RTT\_BUFFER\_SECTION)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00241}00241\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00242}00242\ \textcolor{preprocessor}{\ \ \#define\ SEGGER\_RTT\_PUT\_BUFFER\_SECTION(Var)\ Var}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00243}00243\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00244}00244\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00245}00245\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00246}00246\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00247}00247\ \textcolor{comment}{*\ \ \ \ \ \ \ Static\ const\ data}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00248}00248\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00249}00249\ \textcolor{comment}{**********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00250}00250\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00251}00251\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00252}00252\ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{char}\ \_aTerminalId[16]\ =\ \{\ \textcolor{charliteral}{'0'},\ \textcolor{charliteral}{'1'},\ \textcolor{charliteral}{'2'},\ \textcolor{charliteral}{'3'},\ \textcolor{charliteral}{'4'},\ \textcolor{charliteral}{'5'},\ \textcolor{charliteral}{'6'},\ \textcolor{charliteral}{'7'},\ \textcolor{charliteral}{'8'},\ \textcolor{charliteral}{'9'},\ \textcolor{charliteral}{'A'},\ \textcolor{charliteral}{'B'},\ \textcolor{charliteral}{'C'},\ \textcolor{charliteral}{'D'},\ \textcolor{charliteral}{'E'},\ \textcolor{charliteral}{'F'}\ \};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00253}00253\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00254}00254\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00255}00255\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00256}00256\ \textcolor{comment}{*\ \ \ \ \ \ \ Static\ data}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00257}00257\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00258}00258\ \textcolor{comment}{**********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00259}00259\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00260}00260\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00261}00261\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00262}00262\ \textcolor{comment}{//\ RTT\ Control\ Block\ and\ allocate\ buffers\ for\ channel\ 0}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00263}00263\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00264}00264\ \textcolor{preprocessor}{\#if\ SEGGER\_RTT\_CPU\_CACHE\_LINE\_SIZE}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00265}00265\ \textcolor{preprocessor}{\ \ \#if\ ((defined\ \_\_GNUC\_\_)\ ||\ (defined\ \_\_clang\_\_))}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00266}00266\ \ \ \ \ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}\ \_SEGGER\_RTT\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_\_attribute\_\_\ ((aligned\ (SEGGER\_RTT\_CPU\_CACHE\_LINE\_SIZE)));}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00267}00267\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{char}\ \ \ \_acUpBuffer\ \ [SEGGER\_RTT\_\_ROUND\_UP\_2\_CACHE\_LINE\_SIZE(BUFFER\_SIZE\_UP)]\ \ \ \_\_attribute\_\_\ ((aligned\ (SEGGER\_RTT\_CPU\_CACHE\_LINE\_SIZE)));}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00268}00268\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{char}\ \ \ \_acDownBuffer[SEGGER\_RTT\_\_ROUND\_UP\_2\_CACHE\_LINE\_SIZE(BUFFER\_SIZE\_DOWN)]\ \_\_attribute\_\_\ ((aligned\ (SEGGER\_RTT\_CPU\_CACHE\_LINE\_SIZE)));}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00269}00269\ \textcolor{preprocessor}{\ \ \#elif\ (defined\ \_\_ICCARM\_\_)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00270}00270\ \textcolor{preprocessor}{\ \ \ \ \#pragma\ data\_alignment=SEGGER\_RTT\_CPU\_CACHE\_LINE\_SIZE}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00271}00271\ \ \ \ \ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}\ \_SEGGER\_RTT;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00272}00272\ \textcolor{preprocessor}{\ \ \ \ \#pragma\ data\_alignment=SEGGER\_RTT\_CPU\_CACHE\_LINE\_SIZE}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00273}00273\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{char}\ \ \ \_acUpBuffer\ \ [SEGGER\_RTT\_\_ROUND\_UP\_2\_CACHE\_LINE\_SIZE(BUFFER\_SIZE\_UP)];}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00274}00274\ \textcolor{preprocessor}{\ \ \ \ \#pragma\ data\_alignment=SEGGER\_RTT\_CPU\_CACHE\_LINE\_SIZE}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00275}00275\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{char}\ \ \ \_acDownBuffer[SEGGER\_RTT\_\_ROUND\_UP\_2\_CACHE\_LINE\_SIZE(BUFFER\_SIZE\_DOWN)];}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00276}00276\ \textcolor{preprocessor}{\ \ \#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00277}00277\ \textcolor{preprocessor}{\ \ \ \ \#error\ "{}Don't\ know\ how\ to\ place\ \_SEGGER\_RTT,\ \_acUpBuffer,\ \_acDownBuffer\ cache-\/line\ aligned"{}}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00278}00278\ \textcolor{preprocessor}{\ \ \#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00279}00279\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00280}00280\ \ \ SEGGER\_RTT\_PUT\_CB\_SECTION(SEGGER\_RTT\_CB\_ALIGN(\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}\ \_SEGGER\_RTT));}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00281}00281\ \ \ SEGGER\_RTT\_PUT\_BUFFER\_SECTION(SEGGER\_RTT\_BUFFER\_ALIGN(\textcolor{keyword}{static}\ \textcolor{keywordtype}{char}\ \_acUpBuffer\ \ [BUFFER\_SIZE\_UP]));}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00282}00282\ \ \ SEGGER\_RTT\_PUT\_BUFFER\_SECTION(SEGGER\_RTT\_BUFFER\_ALIGN(\textcolor{keyword}{static}\ \textcolor{keywordtype}{char}\ \_acDownBuffer[BUFFER\_SIZE\_DOWN]));}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00283}00283\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00284}00284\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00285}00285\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{char}\ \_ActiveTerminal;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00286}00286\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00287}00287\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00288}00288\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00289}00289\ \textcolor{comment}{*\ \ \ \ \ \ \ Static\ functions}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00290}00290\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00291}00291\ \textcolor{comment}{**********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00292}00292\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00293}00293\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00294}00294\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00295}00295\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00296}00296\ \textcolor{comment}{*\ \ \ \ \ \ \ \_DoInit()}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00297}00297\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00298}00298\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00299}00299\ \textcolor{comment}{*\ \ \ \ Initializes\ the\ control\ block\ an\ buffers.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00300}00300\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00301}00301\ \textcolor{comment}{*\ \ Notes}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00302}00302\ \textcolor{comment}{*\ \ \ \ (1)\ May\ only\ be\ called\ via\ INIT()\ to\ avoid\ overriding\ settings.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00303}00303\ \textcolor{comment}{*\ \ \ \ \ \ \ \ The\ only\ exception\ is\ SEGGER\_RTT\_Init(),\ to\ make\ an\ intentional\ override\ possible.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00304}00304\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00305}00305\ \textcolor{preprocessor}{\ \ \#define\ INIT()\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00306}00306\ \textcolor{preprocessor}{\ \ \ \ do\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00307}00307\ \textcolor{preprocessor}{\ \ \ \ \ \ volatile\ SEGGER\_RTT\_CB*\ pRTTCBInit;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00308}00308\ \textcolor{preprocessor}{\ \ \ \ \ \ pRTTCBInit\ =\ (volatile\ SEGGER\_RTT\_CB*)((uintptr\_t)\&\_SEGGER\_RTT\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00309}00309\ \textcolor{preprocessor}{\ \ \ \ \ \ if\ (pRTTCBInit-\/>acID[0]\ !=\ 'S')\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00310}00310\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \_DoInit();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00311}00311\ \textcolor{preprocessor}{\ \ \ \ \ \ \}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00312}00312\ \textcolor{preprocessor}{\ \ \ \ \}\ while\ (0)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00313}00313\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00314}00314\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ \_DoInit(\textcolor{keywordtype}{void})\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00315}00315\ \ \ \textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*\ p;\ \ \ \textcolor{comment}{//\ Volatile\ to\ make\ sure\ that\ compiler\ cannot\ change\ the\ order\ of\ accesses\ to\ the\ control\ block}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00316}00316\ \ \ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ \_aInitStr[]\ =\ \textcolor{stringliteral}{"{}\(\backslash\)0\(\backslash\)0\(\backslash\)0\(\backslash\)0\(\backslash\)0\(\backslash\)0TTR\ REGGES"{}};\ \ \textcolor{comment}{//\ Init\ complete\ ID\ string\ to\ make\ sure\ that\ things\ also\ work\ if\ RTT\ is\ linked\ to\ a\ no-\/init\ memory\ area}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00317}00317\ \ \ \textcolor{keywordtype}{unsigned}\ i;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00318}00318\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00319}00319\ \ \ \textcolor{comment}{//\ Initialize\ control\ block}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00320}00320\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00321}00321\ \ \ p\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =\ (\textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*)((uintptr\_t)\&\_SEGGER\_RTT\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ control\ block\ uncached\ so\ that\ nothing\ in\ the\ cache\ ever\ becomes\ dirty\ and\ all\ changes\ are\ visible\ in\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00322}00322\ \ \ memset((\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*)p,\ 0,\ \textcolor{keyword}{sizeof}(\_SEGGER\_RTT));\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Make\ sure\ that\ the\ RTT\ CB\ is\ always\ zero\ initialized.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00323}00323\ \ \ p-\/>MaxNumUpBuffers\ \ \ \ =\ SEGGER\_RTT\_MAX\_NUM\_UP\_BUFFERS;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00324}00324\ \ \ p-\/>MaxNumDownBuffers\ \ =\ SEGGER\_RTT\_MAX\_NUM\_DOWN\_BUFFERS;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00325}00325\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00326}00326\ \ \ \textcolor{comment}{//\ Initialize\ up\ buffer\ 0}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00327}00327\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00328}00328\ \ \ p-\/>aUp[0].sName\ \ \ \ \ \ \ \ \ =\ \textcolor{stringliteral}{"{}Terminal"{}};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00329}00329\ \ \ p-\/>aUp[0].pBuffer\ \ \ \ \ \ \ =\ \_acUpBuffer;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00330}00330\ \ \ p-\/>aUp[0].SizeOfBuffer\ \ =\ BUFFER\_SIZE\_UP;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00331}00331\ \ \ p-\/>aUp[0].RdOff\ \ \ \ \ \ \ \ \ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00332}00332\ \ \ p-\/>aUp[0].WrOff\ \ \ \ \ \ \ \ \ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00333}00333\ \ \ p-\/>aUp[0].Flags\ \ \ \ \ \ \ \ \ =\ SEGGER\_RTT\_MODE\_DEFAULT;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00334}00334\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00335}00335\ \ \ \textcolor{comment}{//\ Initialize\ down\ buffer\ 0}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00336}00336\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00337}00337\ \ \ p-\/>aDown[0].sName\ \ \ \ \ \ \ \ \ =\ \textcolor{stringliteral}{"{}Terminal"{}};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00338}00338\ \ \ p-\/>aDown[0].pBuffer\ \ \ \ \ \ \ =\ \_acDownBuffer;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00339}00339\ \ \ p-\/>aDown[0].SizeOfBuffer\ \ =\ BUFFER\_SIZE\_DOWN;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00340}00340\ \ \ p-\/>aDown[0].RdOff\ \ \ \ \ \ \ \ \ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00341}00341\ \ \ p-\/>aDown[0].WrOff\ \ \ \ \ \ \ \ \ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00342}00342\ \ \ p-\/>aDown[0].Flags\ \ \ \ \ \ \ \ \ =\ SEGGER\_RTT\_MODE\_DEFAULT;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00343}00343\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00344}00344\ \ \ \textcolor{comment}{//\ Finish\ initialization\ of\ the\ control\ block.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00345}00345\ \ \ \textcolor{comment}{//\ Copy\ Id\ string\ backwards\ to\ make\ sure\ that\ "{}SEGGER\ RTT"{}\ is\ not\ found\ in\ initializer\ memory\ (usually\ flash),}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00346}00346\ \ \ \textcolor{comment}{//\ as\ this\ would\ cause\ J-\/Link\ to\ "{}find"{}\ the\ control\ block\ at\ a\ wrong\ address.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00347}00347\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00348}00348\ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ order\ of\ memory\ accesses\ for\ cores\ that\ may\ perform\ out-\/of-\/order\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00349}00349\ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0;\ i\ <\ \textcolor{keyword}{sizeof}(\_aInitStr)\ -\/\ 1;\ ++i)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00350}00350\ \ \ \ \ p-\/>acID[i]\ =\ \_aInitStr[\textcolor{keyword}{sizeof}(\_aInitStr)\ -\/\ 2\ -\/\ i];\ \ \textcolor{comment}{//\ Skip\ terminating\ \(\backslash\)0\ at\ the\ end\ of\ the\ array}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00351}00351\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00352}00352\ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ order\ of\ memory\ accesses\ for\ cores\ that\ may\ perform\ out-\/of-\/order\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00353}00353\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00354}00354\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00355}00355\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00356}00356\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00357}00357\ \textcolor{comment}{*\ \ \ \ \ \ \ \_WriteBlocking()}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00358}00358\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00359}00359\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00360}00360\ \textcolor{comment}{*\ \ \ \ Stores\ a\ specified\ number\ of\ characters\ in\ SEGGER\ RTT\ ring\ buffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00361}00361\ \textcolor{comment}{*\ \ \ \ and\ updates\ the\ associated\ write\ pointer\ which\ is\ periodically}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00362}00362\ \textcolor{comment}{*\ \ \ \ read\ by\ the\ host.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00363}00363\ \textcolor{comment}{*\ \ \ \ The\ caller\ is\ responsible\ for\ managing\ the\ write\ chunk\ sizes\ as}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00364}00364\ \textcolor{comment}{*\ \ \ \ \_WriteBlocking()\ will\ block\ until\ all\ data\ has\ been\ posted\ successfully.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00365}00365\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00366}00366\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00367}00367\ \textcolor{comment}{*\ \ \ \ pRing\ \ \ \ \ \ \ \ Ring\ buffer\ to\ post\ to.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00368}00368\ \textcolor{comment}{*\ \ \ \ pBuffer\ \ \ \ \ \ Pointer\ to\ character\ array.\ Does\ not\ need\ to\ point\ to\ a\ \(\backslash\)0\ terminated\ string.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00369}00369\ \textcolor{comment}{*\ \ \ \ NumBytes\ \ \ \ \ Number\ of\ bytes\ to\ be\ stored\ in\ the\ SEGGER\ RTT\ control\ block.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00370}00370\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00371}00371\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00372}00372\ \textcolor{comment}{*\ \ \ \ >=\ 0\ -\/\ Number\ of\ bytes\ written\ into\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00373}00373\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00374}00374\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{unsigned}\ \_WriteBlocking(\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*\ pRing,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ pBuffer,\ \textcolor{keywordtype}{unsigned}\ NumBytes)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00375}00375\ \ \ \textcolor{keywordtype}{unsigned}\ NumBytesToWrite;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00376}00376\ \ \ \textcolor{keywordtype}{unsigned}\ NumBytesWritten;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00377}00377\ \ \ \textcolor{keywordtype}{unsigned}\ RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00378}00378\ \ \ \textcolor{keywordtype}{unsigned}\ WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00379}00379\ \ \ \textcolor{keyword}{volatile}\ \textcolor{keywordtype}{char}*\ pDst;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00380}00380\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00381}00381\ \ \ \textcolor{comment}{//\ Write\ data\ to\ buffer\ and\ handle\ wrap-\/around\ if\ necessary}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00382}00382\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00383}00383\ \ \ NumBytesWritten\ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00384}00384\ \ \ WrOff\ =\ pRing-\/>WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00385}00385\ \ \ \textcolor{keywordflow}{do}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00386}00386\ \ \ \ \ RdOff\ =\ pRing-\/>RdOff;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ May\ be\ changed\ by\ host\ (debug\ probe)\ in\ the\ meantime}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00387}00387\ \ \ \ \ \textcolor{keywordflow}{if}\ (RdOff\ >\ WrOff)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00388}00388\ \ \ \ \ \ \ NumBytesToWrite\ =\ RdOff\ -\/\ WrOff\ -\/\ 1u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00389}00389\ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00390}00390\ \ \ \ \ \ \ NumBytesToWrite\ =\ pRing-\/>SizeOfBuffer\ -\/\ (WrOff\ -\/\ RdOff\ +\ 1u);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00391}00391\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00392}00392\ \ \ \ \ NumBytesToWrite\ =\ MIN(NumBytesToWrite,\ (pRing-\/>SizeOfBuffer\ -\/\ WrOff));\ \ \ \ \ \ \textcolor{comment}{//\ Number\ of\ bytes\ that\ can\ be\ written\ until\ buffer\ wrap-\/around}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00393}00393\ \ \ \ \ NumBytesToWrite\ =\ MIN(NumBytesToWrite,\ NumBytes);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00394}00394\ \ \ \ \ pDst\ =\ (pRing-\/>pBuffer\ +\ WrOff)\ +\ SEGGER\_RTT\_UNCACHED\_OFF;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00395}00395\ \textcolor{preprocessor}{\#if\ SEGGER\_RTT\_MEMCPY\_USE\_BYTELOOP}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00396}00396\ \ \ \ \ NumBytesWritten\ +=\ NumBytesToWrite;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00397}00397\ \ \ \ \ NumBytes\ \ \ \ \ \ \ \ -\/=\ NumBytesToWrite;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00398}00398\ \ \ \ \ WrOff\ \ \ \ \ \ \ \ \ \ \ +=\ NumBytesToWrite;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00399}00399\ \ \ \ \ \textcolor{keywordflow}{while}\ (NumBytesToWrite-\/-\/)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00400}00400\ \ \ \ \ \ \ *pDst++\ =\ *pBuffer++;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00401}00401\ \ \ \ \ \};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00402}00402\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00403}00403\ \ \ \ \ SEGGER\_RTT\_MEMCPY((\textcolor{keywordtype}{void}*)pDst,\ pBuffer,\ NumBytesToWrite);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00404}00404\ \ \ \ \ NumBytesWritten\ +=\ NumBytesToWrite;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00405}00405\ \ \ \ \ pBuffer\ \ \ \ \ \ \ \ \ +=\ NumBytesToWrite;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00406}00406\ \ \ \ \ NumBytes\ \ \ \ \ \ \ \ -\/=\ NumBytesToWrite;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00407}00407\ \ \ \ \ WrOff\ \ \ \ \ \ \ \ \ \ \ +=\ NumBytesToWrite;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00408}00408\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00409}00409\ \ \ \ \ \textcolor{keywordflow}{if}\ (WrOff\ ==\ pRing-\/>SizeOfBuffer)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00410}00410\ \ \ \ \ \ \ WrOff\ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00411}00411\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00412}00412\ \ \ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ data\ write\ to\ be\ complete\ before\ writing\ the\ <WrOff>,\ in\ case\ CPU\ is\ allowed\ to\ change\ the\ order\ of\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00413}00413\ \ \ \ \ pRing-\/>WrOff\ =\ WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00414}00414\ \ \ \}\ \textcolor{keywordflow}{while}\ (NumBytes);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00415}00415\ \ \ \textcolor{keywordflow}{return}\ NumBytesWritten;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00416}00416\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00417}00417\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00418}00418\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00419}00419\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00420}00420\ \textcolor{comment}{*\ \ \ \ \ \ \ \_WriteNoCheck()}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00421}00421\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00422}00422\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00423}00423\ \textcolor{comment}{*\ \ \ \ Stores\ a\ specified\ number\ of\ characters\ in\ SEGGER\ RTT\ ring\ buffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00424}00424\ \textcolor{comment}{*\ \ \ \ and\ updates\ the\ associated\ write\ pointer\ which\ is\ periodically}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00425}00425\ \textcolor{comment}{*\ \ \ \ read\ by\ the\ host.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00426}00426\ \textcolor{comment}{*\ \ \ \ It\ is\ callers\ responsibility\ to\ make\ sure\ data\ actually\ fits\ in\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00427}00427\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00428}00428\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00429}00429\ \textcolor{comment}{*\ \ \ \ pRing\ \ \ \ \ \ \ \ Ring\ buffer\ to\ post\ to.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00430}00430\ \textcolor{comment}{*\ \ \ \ pBuffer\ \ \ \ \ \ Pointer\ to\ character\ array.\ Does\ not\ need\ to\ point\ to\ a\ \(\backslash\)0\ terminated\ string.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00431}00431\ \textcolor{comment}{*\ \ \ \ NumBytes\ \ \ \ \ Number\ of\ bytes\ to\ be\ stored\ in\ the\ SEGGER\ RTT\ control\ block.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00432}00432\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00433}00433\ \textcolor{comment}{*\ \ Notes}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00434}00434\ \textcolor{comment}{*\ \ \ \ (1)\ If\ there\ might\ not\ be\ enough\ space\ in\ the\ "{}Up"{}-\/buffer,\ call\ \_WriteBlocking}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00435}00435\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00436}00436\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ \_WriteNoCheck(\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*\ pRing,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ pData,\ \textcolor{keywordtype}{unsigned}\ NumBytes)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00437}00437\ \ \ \textcolor{keywordtype}{unsigned}\ NumBytesAtOnce;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00438}00438\ \ \ \textcolor{keywordtype}{unsigned}\ WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00439}00439\ \ \ \textcolor{keywordtype}{unsigned}\ Rem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00440}00440\ \ \ \textcolor{keyword}{volatile}\ \textcolor{keywordtype}{char}*\ pDst;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00441}00441\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00442}00442\ \ \ WrOff\ =\ pRing-\/>WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00443}00443\ \ \ Rem\ =\ pRing-\/>SizeOfBuffer\ -\/\ WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00444}00444\ \ \ \textcolor{keywordflow}{if}\ (Rem\ >\ NumBytes)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00445}00445\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00446}00446\ \ \ \ \ \textcolor{comment}{//\ All\ data\ fits\ before\ wrap\ around}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00447}00447\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00448}00448\ \ \ \ \ pDst\ =\ (pRing-\/>pBuffer\ +\ WrOff)\ +\ SEGGER\_RTT\_UNCACHED\_OFF;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00449}00449\ \textcolor{preprocessor}{\#if\ SEGGER\_RTT\_MEMCPY\_USE\_BYTELOOP}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00450}00450\ \ \ \ \ WrOff\ +=\ NumBytes;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00451}00451\ \ \ \ \ \textcolor{keywordflow}{while}\ (NumBytes-\/-\/)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00452}00452\ \ \ \ \ \ \ *pDst++\ =\ *pData++;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00453}00453\ \ \ \ \ \};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00454}00454\ \ \ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ data\ write\ to\ be\ complete\ before\ writing\ the\ <WrOff>,\ in\ case\ CPU\ is\ allowed\ to\ change\ the\ order\ of\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00455}00455\ \ \ \ \ pRing-\/>WrOff\ =\ WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00456}00456\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00457}00457\ \ \ \ \ SEGGER\_RTT\_MEMCPY((\textcolor{keywordtype}{void}*)pDst,\ pData,\ NumBytes);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00458}00458\ \ \ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ data\ write\ to\ be\ complete\ before\ writing\ the\ <WrOff>,\ in\ case\ CPU\ is\ allowed\ to\ change\ the\ order\ of\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00459}00459\ \ \ \ \ pRing-\/>WrOff\ =\ WrOff\ +\ NumBytes;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00460}00460\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00461}00461\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00462}00462\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00463}00463\ \ \ \ \ \textcolor{comment}{//\ We\ reach\ the\ end\ of\ the\ buffer,\ so\ need\ to\ wrap\ around}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00464}00464\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00465}00465\ \textcolor{preprocessor}{\#if\ SEGGER\_RTT\_MEMCPY\_USE\_BYTELOOP}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00466}00466\ \ \ \ \ pDst\ =\ (pRing-\/>pBuffer\ +\ WrOff)\ +\ SEGGER\_RTT\_UNCACHED\_OFF;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00467}00467\ \ \ \ \ NumBytesAtOnce\ =\ Rem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00468}00468\ \ \ \ \ \textcolor{keywordflow}{while}\ (NumBytesAtOnce-\/-\/)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00469}00469\ \ \ \ \ \ \ *pDst++\ =\ *pData++;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00470}00470\ \ \ \ \ \};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00471}00471\ \ \ \ \ pDst\ =\ pRing-\/>pBuffer\ +\ SEGGER\_RTT\_UNCACHED\_OFF;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00472}00472\ \ \ \ \ NumBytesAtOnce\ =\ NumBytes\ -\/\ Rem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00473}00473\ \ \ \ \ \textcolor{keywordflow}{while}\ (NumBytesAtOnce-\/-\/)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00474}00474\ \ \ \ \ \ \ *pDst++\ =\ *pData++;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00475}00475\ \ \ \ \ \};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00476}00476\ \ \ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ data\ write\ to\ be\ complete\ before\ writing\ the\ <WrOff>,\ in\ case\ CPU\ is\ allowed\ to\ change\ the\ order\ of\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00477}00477\ \ \ \ \ pRing-\/>WrOff\ =\ NumBytes\ -\/\ Rem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00478}00478\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00479}00479\ \ \ \ \ NumBytesAtOnce\ =\ Rem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00480}00480\ \ \ \ \ pDst\ =\ (pRing-\/>pBuffer\ +\ WrOff)\ +\ SEGGER\_RTT\_UNCACHED\_OFF;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00481}00481\ \ \ \ \ SEGGER\_RTT\_MEMCPY((\textcolor{keywordtype}{void}*)pDst,\ pData,\ NumBytesAtOnce);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00482}00482\ \ \ \ \ NumBytesAtOnce\ =\ NumBytes\ -\/\ Rem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00483}00483\ \ \ \ \ pDst\ =\ pRing-\/>pBuffer\ +\ SEGGER\_RTT\_UNCACHED\_OFF;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00484}00484\ \ \ \ \ SEGGER\_RTT\_MEMCPY((\textcolor{keywordtype}{void}*)pDst,\ pData\ +\ Rem,\ NumBytesAtOnce);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00485}00485\ \ \ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ data\ write\ to\ be\ complete\ before\ writing\ the\ <WrOff>,\ in\ case\ CPU\ is\ allowed\ to\ change\ the\ order\ of\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00486}00486\ \ \ \ \ pRing-\/>WrOff\ =\ NumBytesAtOnce;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00487}00487\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00488}00488\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00489}00489\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00490}00490\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00491}00491\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00492}00492\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00493}00493\ \textcolor{comment}{*\ \ \ \ \ \ \ \_PostTerminalSwitch()}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00494}00494\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00495}00495\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00496}00496\ \textcolor{comment}{*\ \ \ \ Switch\ terminal\ to\ the\ given\ terminal\ ID.\ \ It\ is\ the\ caller's}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00497}00497\ \textcolor{comment}{*\ \ \ \ responsibility\ to\ ensure\ the\ terminal\ ID\ is\ correct\ and\ there\ is}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00498}00498\ \textcolor{comment}{*\ \ \ \ enough\ space\ in\ the\ buffer\ for\ this\ to\ complete\ successfully.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00499}00499\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00500}00500\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00501}00501\ \textcolor{comment}{*\ \ \ \ pRing\ \ \ \ \ \ \ \ Ring\ buffer\ to\ post\ to.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00502}00502\ \textcolor{comment}{*\ \ \ \ TerminalId\ \ \ Terminal\ ID\ to\ switch\ to.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00503}00503\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00504}00504\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ \_PostTerminalSwitch(\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*\ pRing,\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{char}\ TerminalId)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00505}00505\ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{char}\ ac[2];}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00506}00506\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00507}00507\ \ \ ac[0]\ =\ 0xFFu;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00508}00508\ \ \ ac[1]\ =\ \_aTerminalId[TerminalId];\ \ \textcolor{comment}{//\ Caller\ made\ already\ sure\ that\ TerminalId\ does\ not\ exceed\ our\ terminal\ limit}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00509}00509\ \ \ \_WriteBlocking(pRing,\ (\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*)ac,\ 2u);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00510}00510\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00511}00511\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00512}00512\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00513}00513\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00514}00514\ \textcolor{comment}{*\ \ \ \ \ \ \ \_GetAvailWriteSpace()}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00515}00515\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00516}00516\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00517}00517\ \textcolor{comment}{*\ \ \ \ Returns\ the\ number\ of\ bytes\ that\ can\ be\ written\ to\ the\ ring}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00518}00518\ \textcolor{comment}{*\ \ \ \ buffer\ without\ blocking.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00519}00519\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00520}00520\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00521}00521\ \textcolor{comment}{*\ \ \ \ pRing\ \ \ \ \ \ \ \ Ring\ buffer\ to\ check.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00522}00522\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00523}00523\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00524}00524\ \textcolor{comment}{*\ \ \ \ Number\ of\ bytes\ that\ are\ free\ in\ the\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00525}00525\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00526}00526\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{unsigned}\ \_GetAvailWriteSpace(\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*\ pRing)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00527}00527\ \ \ \textcolor{keywordtype}{unsigned}\ RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00528}00528\ \ \ \textcolor{keywordtype}{unsigned}\ WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00529}00529\ \ \ \textcolor{keywordtype}{unsigned}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00530}00530\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00531}00531\ \ \ \textcolor{comment}{//\ Avoid\ warnings\ regarding\ volatile\ access\ order.\ \ It's\ not\ a\ problem}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00532}00532\ \ \ \textcolor{comment}{//\ in\ this\ case,\ but\ dampen\ compiler\ enthusiasm.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00533}00533\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00534}00534\ \ \ RdOff\ =\ pRing-\/>RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00535}00535\ \ \ WrOff\ =\ pRing-\/>WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00536}00536\ \ \ \textcolor{keywordflow}{if}\ (RdOff\ <=\ WrOff)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00537}00537\ \ \ \ \ r\ =\ pRing-\/>SizeOfBuffer\ -\/\ 1u\ -\/\ WrOff\ +\ RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00538}00538\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00539}00539\ \ \ \ \ r\ =\ RdOff\ -\/\ WrOff\ -\/\ 1u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00540}00540\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00541}00541\ \ \ \textcolor{keywordflow}{return}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00542}00542\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00543}00543\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00544}00544\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00545}00545\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00546}00546\ \textcolor{comment}{*\ \ \ \ \ \ \ Public\ code}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00547}00547\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00548}00548\ \textcolor{comment}{**********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00549}00549\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00550}00550\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00551}00551\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00552}00552\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00553}00553\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_ReadUpBufferNoLock()}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00554}00554\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00555}00555\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00556}00556\ \textcolor{comment}{*\ \ \ \ Reads\ characters\ from\ SEGGER\ real-\/time-\/terminal\ control\ block}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00557}00557\ \textcolor{comment}{*\ \ \ \ which\ have\ been\ previously\ stored\ by\ the\ application.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00558}00558\ \textcolor{comment}{*\ \ \ \ Do\ not\ lock\ against\ interrupts\ and\ multiple\ access.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00559}00559\ \textcolor{comment}{*\ \ \ \ Used\ to\ do\ the\ same\ operation\ that\ J-\/Link\ does,\ to\ transfer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00560}00560\ \textcolor{comment}{*\ \ \ \ RTT\ data\ via\ other\ channels,\ such\ as\ TCP/IP\ or\ UART.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00561}00561\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00562}00562\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00563}00563\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ Up-\/buffer\ to\ be\ used.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00564}00564\ \textcolor{comment}{*\ \ \ \ pBuffer\ \ \ \ \ \ Pointer\ to\ buffer\ provided\ by\ target\ application,\ to\ copy\ characters\ from\ RTT-\/up-\/buffer\ to.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00565}00565\ \textcolor{comment}{*\ \ \ \ BufferSize\ \ \ Size\ of\ the\ target\ application\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00566}00566\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00567}00567\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00568}00568\ \textcolor{comment}{*\ \ \ \ Number\ of\ bytes\ that\ have\ been\ read.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00569}00569\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00570}00570\ \textcolor{comment}{*\ \ Additional\ information}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00571}00571\ \textcolor{comment}{*\ \ \ \ This\ function\ must\ not\ be\ called\ when\ J-\/Link\ might\ also\ do\ RTT.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00572}00572\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00573}00573\ \textcolor{keywordtype}{unsigned}\ SEGGER\_RTT\_ReadUpBufferNoLock(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keywordtype}{void}*\ pData,\ \textcolor{keywordtype}{unsigned}\ BufferSize)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00574}00574\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00575}00575\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NumBytesRead;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00576}00576\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00577}00577\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00578}00578\ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{char}*\ \ \ \ \ \ \ \ \ \ pBuffer;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00579}00579\ \ \ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*\ \ \ pRing;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00580}00580\ \ \ \textcolor{keyword}{volatile}\ \textcolor{keywordtype}{char}*\ \ \ \ \ \ \ \ \ \ pSrc;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00581}00581\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00582}00582\ \ \ INIT();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00583}00583\ \ \ pRing\ =\ (\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*)((uintptr\_t)\&\_SEGGER\_RTT.aUp[BufferIndex]\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00584}00584\ \ \ pBuffer\ =\ (\textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{char}*)pData;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00585}00585\ \ \ RdOff\ =\ pRing-\/>RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00586}00586\ \ \ WrOff\ =\ pRing-\/>WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00587}00587\ \ \ NumBytesRead\ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00588}00588\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00589}00589\ \ \ \textcolor{comment}{//\ Read\ from\ current\ read\ position\ to\ wrap-\/around\ of\ buffer,\ first}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00590}00590\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00591}00591\ \ \ \textcolor{keywordflow}{if}\ (RdOff\ >\ WrOff)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00592}00592\ \ \ \ \ NumBytesRem\ =\ pRing-\/>SizeOfBuffer\ -\/\ RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00593}00593\ \ \ \ \ NumBytesRem\ =\ MIN(NumBytesRem,\ BufferSize);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00594}00594\ \ \ \ \ pSrc\ =\ (pRing-\/>pBuffer\ +\ RdOff)\ +\ SEGGER\_RTT\_UNCACHED\_OFF;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00595}00595\ \textcolor{preprocessor}{\#if\ SEGGER\_RTT\_MEMCPY\_USE\_BYTELOOP}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00596}00596\ \ \ \ \ NumBytesRead\ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00597}00597\ \ \ \ \ BufferSize\ \ \ -\/=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00598}00598\ \ \ \ \ RdOff\ \ \ \ \ \ \ \ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00599}00599\ \ \ \ \ \textcolor{keywordflow}{while}\ (NumBytesRem-\/-\/)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00600}00600\ \ \ \ \ \ \ *pBuffer++\ =\ *pSrc++;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00601}00601\ \ \ \ \ \};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00602}00602\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00603}00603\ \ \ \ \ SEGGER\_RTT\_MEMCPY(pBuffer,\ (\textcolor{keywordtype}{void}*)pSrc,\ NumBytesRem);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00604}00604\ \ \ \ \ NumBytesRead\ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00605}00605\ \ \ \ \ pBuffer\ \ \ \ \ \ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00606}00606\ \ \ \ \ BufferSize\ \ \ -\/=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00607}00607\ \ \ \ \ RdOff\ \ \ \ \ \ \ \ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00608}00608\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00609}00609\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00610}00610\ \ \ \ \ \textcolor{comment}{//\ Handle\ wrap-\/around\ of\ buffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00611}00611\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00612}00612\ \ \ \ \ \textcolor{keywordflow}{if}\ (RdOff\ ==\ pRing-\/>SizeOfBuffer)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00613}00613\ \ \ \ \ \ \ RdOff\ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00614}00614\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00615}00615\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00616}00616\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00617}00617\ \ \ \textcolor{comment}{//\ Read\ remaining\ items\ of\ buffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00618}00618\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00619}00619\ \ \ NumBytesRem\ =\ WrOff\ -\/\ RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00620}00620\ \ \ NumBytesRem\ =\ MIN(NumBytesRem,\ BufferSize);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00621}00621\ \ \ \textcolor{keywordflow}{if}\ (NumBytesRem\ >\ 0u)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00622}00622\ \ \ \ \ pSrc\ =\ (pRing-\/>pBuffer\ +\ RdOff)\ +\ SEGGER\_RTT\_UNCACHED\_OFF;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00623}00623\ \textcolor{preprocessor}{\#if\ SEGGER\_RTT\_MEMCPY\_USE\_BYTELOOP}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00624}00624\ \ \ \ \ NumBytesRead\ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00625}00625\ \ \ \ \ BufferSize\ \ \ -\/=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00626}00626\ \ \ \ \ RdOff\ \ \ \ \ \ \ \ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00627}00627\ \ \ \ \ \textcolor{keywordflow}{while}\ (NumBytesRem-\/-\/)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00628}00628\ \ \ \ \ \ \ *pBuffer++\ =\ *pSrc++;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00629}00629\ \ \ \ \ \};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00630}00630\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00631}00631\ \ \ \ \ SEGGER\_RTT\_MEMCPY(pBuffer,\ (\textcolor{keywordtype}{void}*)pSrc,\ NumBytesRem);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00632}00632\ \ \ \ \ NumBytesRead\ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00633}00633\ \ \ \ \ pBuffer\ \ \ \ \ \ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00634}00634\ \ \ \ \ BufferSize\ \ \ -\/=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00635}00635\ \ \ \ \ RdOff\ \ \ \ \ \ \ \ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00636}00636\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00637}00637\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00638}00638\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00639}00639\ \ \ \textcolor{comment}{//\ Update\ read\ offset\ of\ buffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00640}00640\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00641}00641\ \ \ \textcolor{keywordflow}{if}\ (NumBytesRead)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00642}00642\ \ \ \ \ pRing-\/>RdOff\ =\ RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00643}00643\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00644}00644\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00645}00645\ \ \ \textcolor{keywordflow}{return}\ NumBytesRead;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00646}00646\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00647}00647\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00648}00648\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00649}00649\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00650}00650\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_ReadNoLock()}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00651}00651\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00652}00652\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00653}00653\ \textcolor{comment}{*\ \ \ \ Reads\ characters\ from\ SEGGER\ real-\/time-\/terminal\ control\ block}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00654}00654\ \textcolor{comment}{*\ \ \ \ which\ have\ been\ previously\ stored\ by\ the\ host.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00655}00655\ \textcolor{comment}{*\ \ \ \ Do\ not\ lock\ against\ interrupts\ and\ multiple\ access.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00656}00656\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00657}00657\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00658}00658\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ Down-\/buffer\ to\ be\ used\ (e.g.\ 0\ for\ "{}Terminal"{}).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00659}00659\ \textcolor{comment}{*\ \ \ \ pBuffer\ \ \ \ \ \ Pointer\ to\ buffer\ provided\ by\ target\ application,\ to\ copy\ characters\ from\ RTT-\/down-\/buffer\ to.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00660}00660\ \textcolor{comment}{*\ \ \ \ BufferSize\ \ \ Size\ of\ the\ target\ application\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00661}00661\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00662}00662\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00663}00663\ \textcolor{comment}{*\ \ \ \ Number\ of\ bytes\ that\ have\ been\ read.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00664}00664\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00665}00665\ \textcolor{keywordtype}{unsigned}\ SEGGER\_RTT\_ReadNoLock(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keywordtype}{void}*\ pData,\ \textcolor{keywordtype}{unsigned}\ BufferSize)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00666}00666\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00667}00667\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ NumBytesRead;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00668}00668\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00669}00669\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00670}00670\ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{char}*\ \ \ \ \ \ \ \ \ \ pBuffer;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00671}00671\ \ \ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___d_o_w_n}{SEGGER\_RTT\_BUFFER\_DOWN}}*\ pRing;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00672}00672\ \ \ \textcolor{keyword}{volatile}\ \textcolor{keywordtype}{char}*\ \ \ \ \ \ \ \ \ \ pSrc;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00673}00673\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00674}00674\ \ \ INIT();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00675}00675\ \ \ pRing\ =\ (\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___d_o_w_n}{SEGGER\_RTT\_BUFFER\_DOWN}}*)((uintptr\_t)\&\_SEGGER\_RTT.aDown[BufferIndex]\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00676}00676\ \ \ pBuffer\ =\ (\textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{char}*)pData;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00677}00677\ \ \ RdOff\ =\ pRing-\/>RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00678}00678\ \ \ WrOff\ =\ pRing-\/>WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00679}00679\ \ \ NumBytesRead\ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00680}00680\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00681}00681\ \ \ \textcolor{comment}{//\ Read\ from\ current\ read\ position\ to\ wrap-\/around\ of\ buffer,\ first}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00682}00682\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00683}00683\ \ \ \textcolor{keywordflow}{if}\ (RdOff\ >\ WrOff)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00684}00684\ \ \ \ \ NumBytesRem\ =\ pRing-\/>SizeOfBuffer\ -\/\ RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00685}00685\ \ \ \ \ NumBytesRem\ =\ MIN(NumBytesRem,\ BufferSize);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00686}00686\ \ \ \ \ pSrc\ =\ (pRing-\/>pBuffer\ +\ RdOff)\ +\ SEGGER\_RTT\_UNCACHED\_OFF;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00687}00687\ \textcolor{preprocessor}{\#if\ SEGGER\_RTT\_MEMCPY\_USE\_BYTELOOP}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00688}00688\ \ \ \ \ NumBytesRead\ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00689}00689\ \ \ \ \ BufferSize\ \ \ -\/=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00690}00690\ \ \ \ \ RdOff\ \ \ \ \ \ \ \ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00691}00691\ \ \ \ \ \textcolor{keywordflow}{while}\ (NumBytesRem-\/-\/)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00692}00692\ \ \ \ \ \ \ *pBuffer++\ =\ *pSrc++;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00693}00693\ \ \ \ \ \};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00694}00694\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00695}00695\ \ \ \ \ SEGGER\_RTT\_MEMCPY(pBuffer,\ (\textcolor{keywordtype}{void}*)pSrc,\ NumBytesRem);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00696}00696\ \ \ \ \ NumBytesRead\ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00697}00697\ \ \ \ \ pBuffer\ \ \ \ \ \ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00698}00698\ \ \ \ \ BufferSize\ \ \ -\/=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00699}00699\ \ \ \ \ RdOff\ \ \ \ \ \ \ \ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00700}00700\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00701}00701\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00702}00702\ \ \ \ \ \textcolor{comment}{//\ Handle\ wrap-\/around\ of\ buffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00703}00703\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00704}00704\ \ \ \ \ \textcolor{keywordflow}{if}\ (RdOff\ ==\ pRing-\/>SizeOfBuffer)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00705}00705\ \ \ \ \ \ \ RdOff\ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00706}00706\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00707}00707\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00708}00708\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00709}00709\ \ \ \textcolor{comment}{//\ Read\ remaining\ items\ of\ buffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00710}00710\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00711}00711\ \ \ NumBytesRem\ =\ WrOff\ -\/\ RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00712}00712\ \ \ NumBytesRem\ =\ MIN(NumBytesRem,\ BufferSize);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00713}00713\ \ \ \textcolor{keywordflow}{if}\ (NumBytesRem\ >\ 0u)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00714}00714\ \ \ \ \ pSrc\ =\ (pRing-\/>pBuffer\ +\ RdOff)\ +\ SEGGER\_RTT\_UNCACHED\_OFF;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00715}00715\ \textcolor{preprocessor}{\#if\ SEGGER\_RTT\_MEMCPY\_USE\_BYTELOOP}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00716}00716\ \ \ \ \ NumBytesRead\ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00717}00717\ \ \ \ \ BufferSize\ \ \ -\/=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00718}00718\ \ \ \ \ RdOff\ \ \ \ \ \ \ \ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00719}00719\ \ \ \ \ \textcolor{keywordflow}{while}\ (NumBytesRem-\/-\/)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00720}00720\ \ \ \ \ \ \ *pBuffer++\ =\ *pSrc++;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00721}00721\ \ \ \ \ \};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00722}00722\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00723}00723\ \ \ \ \ SEGGER\_RTT\_MEMCPY(pBuffer,\ (\textcolor{keywordtype}{void}*)pSrc,\ NumBytesRem);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00724}00724\ \ \ \ \ NumBytesRead\ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00725}00725\ \ \ \ \ pBuffer\ \ \ \ \ \ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00726}00726\ \ \ \ \ BufferSize\ \ \ -\/=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00727}00727\ \ \ \ \ RdOff\ \ \ \ \ \ \ \ +=\ NumBytesRem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00728}00728\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00729}00729\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00730}00730\ \ \ \textcolor{keywordflow}{if}\ (NumBytesRead)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00731}00731\ \ \ \ \ pRing-\/>RdOff\ =\ RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00732}00732\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00733}00733\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00734}00734\ \ \ \textcolor{keywordflow}{return}\ NumBytesRead;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00735}00735\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00736}00736\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00737}00737\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00738}00738\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00739}00739\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_ReadUpBuffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00740}00740\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00741}00741\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00742}00742\ \textcolor{comment}{*\ \ \ \ Reads\ characters\ from\ SEGGER\ real-\/time-\/terminal\ control\ block}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00743}00743\ \textcolor{comment}{*\ \ \ \ which\ have\ been\ previously\ stored\ by\ the\ application.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00744}00744\ \textcolor{comment}{*\ \ \ \ Used\ to\ do\ the\ same\ operation\ that\ J-\/Link\ does,\ to\ transfer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00745}00745\ \textcolor{comment}{*\ \ \ \ RTT\ data\ via\ other\ channels,\ such\ as\ TCP/IP\ or\ UART.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00746}00746\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00747}00747\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00748}00748\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ Up-\/buffer\ to\ be\ used.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00749}00749\ \textcolor{comment}{*\ \ \ \ pBuffer\ \ \ \ \ \ Pointer\ to\ buffer\ provided\ by\ target\ application,\ to\ copy\ characters\ from\ RTT-\/up-\/buffer\ to.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00750}00750\ \textcolor{comment}{*\ \ \ \ BufferSize\ \ \ Size\ of\ the\ target\ application\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00751}00751\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00752}00752\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00753}00753\ \textcolor{comment}{*\ \ \ \ Number\ of\ bytes\ that\ have\ been\ read.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00754}00754\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00755}00755\ \textcolor{comment}{*\ \ Additional\ information}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00756}00756\ \textcolor{comment}{*\ \ \ \ This\ function\ must\ not\ be\ called\ when\ J-\/Link\ might\ also\ do\ RTT.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00757}00757\ \textcolor{comment}{*\ \ \ \ This\ function\ locks\ against\ all\ other\ RTT\ operations.\ I.e.\ during}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00758}00758\ \textcolor{comment}{*\ \ \ \ the\ read\ operation,\ writing\ is\ also\ locked.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00759}00759\ \textcolor{comment}{*\ \ \ \ If\ only\ one\ consumer\ reads\ from\ the\ up\ buffer,}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00760}00760\ \textcolor{comment}{*\ \ \ \ call\ sEGGER\_RTT\_ReadUpBufferNoLock()\ instead.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00761}00761\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00762}00762\ \textcolor{keywordtype}{unsigned}\ SEGGER\_RTT\_ReadUpBuffer(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keywordtype}{void}*\ pBuffer,\ \textcolor{keywordtype}{unsigned}\ BufferSize)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00763}00763\ \ \ \textcolor{keywordtype}{unsigned}\ NumBytesRead;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00764}00764\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00765}00765\ \ \ SEGGER\_RTT\_LOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00766}00766\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00767}00767\ \ \ \textcolor{comment}{//\ Call\ the\ non-\/locking\ read\ function}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00768}00768\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00769}00769\ \ \ NumBytesRead\ =\ SEGGER\_RTT\_ReadUpBufferNoLock(BufferIndex,\ pBuffer,\ BufferSize);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00770}00770\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00771}00771\ \ \ \textcolor{comment}{//\ Finish\ up.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00772}00772\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00773}00773\ \ \ SEGGER\_RTT\_UNLOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00774}00774\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00775}00775\ \ \ \textcolor{keywordflow}{return}\ NumBytesRead;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00776}00776\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00777}00777\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00778}00778\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00779}00779\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00780}00780\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_Read}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00781}00781\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00782}00782\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00783}00783\ \textcolor{comment}{*\ \ \ \ Reads\ characters\ from\ SEGGER\ real-\/time-\/terminal\ control\ block}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00784}00784\ \textcolor{comment}{*\ \ \ \ which\ have\ been\ previously\ stored\ by\ the\ host.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00785}00785\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00786}00786\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00787}00787\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ Down-\/buffer\ to\ be\ used\ (e.g.\ 0\ for\ "{}Terminal"{}).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00788}00788\ \textcolor{comment}{*\ \ \ \ pBuffer\ \ \ \ \ \ Pointer\ to\ buffer\ provided\ by\ target\ application,\ to\ copy\ characters\ from\ RTT-\/down-\/buffer\ to.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00789}00789\ \textcolor{comment}{*\ \ \ \ BufferSize\ \ \ Size\ of\ the\ target\ application\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00790}00790\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00791}00791\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00792}00792\ \textcolor{comment}{*\ \ \ \ Number\ of\ bytes\ that\ have\ been\ read.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00793}00793\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00794}00794\ \textcolor{keywordtype}{unsigned}\ SEGGER\_RTT\_Read(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keywordtype}{void}*\ pBuffer,\ \textcolor{keywordtype}{unsigned}\ BufferSize)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00795}00795\ \ \ \textcolor{keywordtype}{unsigned}\ NumBytesRead;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00796}00796\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00797}00797\ \ \ SEGGER\_RTT\_LOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00798}00798\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00799}00799\ \ \ \textcolor{comment}{//\ Call\ the\ non-\/locking\ read\ function}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00800}00800\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00801}00801\ \ \ NumBytesRead\ =\ SEGGER\_RTT\_ReadNoLock(BufferIndex,\ pBuffer,\ BufferSize);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00802}00802\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00803}00803\ \ \ \textcolor{comment}{//\ Finish\ up.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00804}00804\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00805}00805\ \ \ SEGGER\_RTT\_UNLOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00806}00806\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00807}00807\ \ \ \textcolor{keywordflow}{return}\ NumBytesRead;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00808}00808\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00809}00809\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00810}00810\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00811}00811\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00812}00812\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_WriteWithOverwriteNoLock}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00813}00813\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00814}00814\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00815}00815\ \textcolor{comment}{*\ \ \ \ Stores\ a\ specified\ number\ of\ characters\ in\ SEGGER\ RTT}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00816}00816\ \textcolor{comment}{*\ \ \ \ control\ block.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00817}00817\ \textcolor{comment}{*\ \ \ \ SEGGER\_RTT\_WriteWithOverwriteNoLock\ does\ not\ lock\ the\ application}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00818}00818\ \textcolor{comment}{*\ \ \ \ and\ overwrites\ data\ if\ the\ data\ does\ not\ fit\ into\ the\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00819}00819\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00820}00820\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00821}00821\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ "{}Up"{}-\/buffer\ to\ be\ used\ (e.g.\ 0\ for\ "{}Terminal"{}).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00822}00822\ \textcolor{comment}{*\ \ \ \ pBuffer\ \ \ \ \ \ Pointer\ to\ character\ array.\ Does\ not\ need\ to\ point\ to\ a\ \(\backslash\)0\ terminated\ string.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00823}00823\ \textcolor{comment}{*\ \ \ \ NumBytes\ \ \ \ \ Number\ of\ bytes\ to\ be\ stored\ in\ the\ SEGGER\ RTT\ control\ block.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00824}00824\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00825}00825\ \textcolor{comment}{*\ \ Notes}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00826}00826\ \textcolor{comment}{*\ \ \ \ (1)\ If\ there\ is\ not\ enough\ space\ in\ the\ "{}Up"{}-\/buffer,\ data\ is\ overwritten.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00827}00827\ \textcolor{comment}{*\ \ \ \ (2)\ For\ performance\ reasons\ this\ function\ does\ not\ call\ Init()}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00828}00828\ \textcolor{comment}{*\ \ \ \ \ \ \ \ and\ may\ only\ be\ called\ after\ RTT\ has\ been\ initialized.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00829}00829\ \textcolor{comment}{*\ \ \ \ \ \ \ \ Either\ by\ calling\ SEGGER\_RTT\_Init()\ or\ calling\ another\ RTT\ API\ function\ first.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00830}00830\ \textcolor{comment}{*\ \ \ \ (3)\ Do\ not\ use\ SEGGER\_RTT\_WriteWithOverwriteNoLock\ if\ a\ J-\/Link}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00831}00831\ \textcolor{comment}{*\ \ \ \ \ \ \ \ connection\ reads\ RTT\ data.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00832}00832\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00833}00833\ \textcolor{keywordtype}{void}\ SEGGER\_RTT\_WriteWithOverwriteNoLock(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{void}*\ pBuffer,\ \textcolor{keywordtype}{unsigned}\ NumBytes)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00834}00834\ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ \ \ \ \ \ \ \ \ \ \ pData;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00835}00835\ \ \ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*\ pRing;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00836}00836\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ Avail;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00837}00837\ \ \ \textcolor{keyword}{volatile}\ \textcolor{keywordtype}{char}*\ \ \ \ \ \ \ \ pDst;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00838}00838\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00839}00839\ \ \ \textcolor{comment}{//\ Get\ "{}to-\/host"{}\ ring\ buffer\ and\ copy\ some\ elements\ into\ local\ variables.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00840}00840\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00841}00841\ \ \ pData\ =\ (\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *)pBuffer;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00842}00842\ \ \ pRing\ =\ (\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*)((uintptr\_t)\&\_SEGGER\_RTT.aUp[BufferIndex]\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00843}00843\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00844}00844\ \ \ \textcolor{comment}{//\ Check\ if\ we\ will\ overwrite\ data\ and\ need\ to\ adjust\ the\ RdOff.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00845}00845\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00846}00846\ \ \ \textcolor{keywordflow}{if}\ (pRing-\/>WrOff\ ==\ pRing-\/>RdOff)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00847}00847\ \ \ \ \ Avail\ =\ pRing-\/>SizeOfBuffer\ -\/\ 1u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00848}00848\ \ \ \}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (\ pRing-\/>WrOff\ <\ pRing-\/>RdOff)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00849}00849\ \ \ \ \ Avail\ =\ pRing-\/>RdOff\ -\/\ pRing-\/>WrOff\ -\/\ 1u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00850}00850\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00851}00851\ \ \ \ \ Avail\ =\ pRing-\/>RdOff\ -\/\ pRing-\/>WrOff\ -\/\ 1u\ +\ pRing-\/>SizeOfBuffer;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00852}00852\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00853}00853\ \ \ \textcolor{keywordflow}{if}\ (NumBytes\ >\ Avail)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00854}00854\ \ \ \ \ pRing-\/>RdOff\ +=\ (NumBytes\ -\/\ Avail);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00855}00855\ \ \ \ \ \textcolor{keywordflow}{while}\ (pRing-\/>RdOff\ >=\ pRing-\/>SizeOfBuffer)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00856}00856\ \ \ \ \ \ \ pRing-\/>RdOff\ -\/=\ pRing-\/>SizeOfBuffer;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00857}00857\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00858}00858\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00859}00859\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00860}00860\ \ \ \textcolor{comment}{//\ Write\ all\ data,\ no\ need\ to\ check\ the\ RdOff,\ but\ possibly\ handle\ multiple\ wrap-\/arounds}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00861}00861\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00862}00862\ \ \ Avail\ =\ pRing-\/>SizeOfBuffer\ -\/\ pRing-\/>WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00863}00863\ \ \ \textcolor{keywordflow}{do}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00864}00864\ \ \ \ \ \textcolor{keywordflow}{if}\ (Avail\ >\ NumBytes)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00865}00865\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00866}00866\ \ \ \ \ \ \ \textcolor{comment}{//\ Last\ round}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00867}00867\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00868}00868\ \ \ \ \ \ \ pDst\ =\ (pRing-\/>pBuffer\ +\ pRing-\/>WrOff)\ +\ SEGGER\_RTT\_UNCACHED\_OFF;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00869}00869\ \textcolor{preprocessor}{\#if\ SEGGER\_RTT\_MEMCPY\_USE\_BYTELOOP}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00870}00870\ \ \ \ \ \ \ Avail\ =\ NumBytes;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00871}00871\ \ \ \ \ \ \ \textcolor{keywordflow}{while}\ (NumBytes-\/-\/)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00872}00872\ \ \ \ \ \ \ \ \ *pDst++\ =\ *pData++;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00873}00873\ \ \ \ \ \ \ \};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00874}00874\ \ \ \ \ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ data\ write\ to\ be\ complete\ before\ writing\ the\ <WrOff>,\ in\ case\ CPU\ is\ allowed\ to\ change\ the\ order\ of\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00875}00875\ \ \ \ \ \ \ pRing-\/>WrOff\ +=\ Avail;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00876}00876\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00877}00877\ \ \ \ \ \ \ SEGGER\_RTT\_MEMCPY((\textcolor{keywordtype}{void}*)pDst,\ pData,\ NumBytes);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00878}00878\ \ \ \ \ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ data\ write\ to\ be\ complete\ before\ writing\ the\ <WrOff>,\ in\ case\ CPU\ is\ allowed\ to\ change\ the\ order\ of\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00879}00879\ \ \ \ \ \ \ pRing-\/>WrOff\ +=\ NumBytes;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00880}00880\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00881}00881\ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00882}00882\ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00883}00883\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00884}00884\ \ \ \ \ \ \ \textcolor{comment}{//\ \ Wrap-\/around\ necessary,\ write\ until\ wrap-\/around\ and\ reset\ WrOff}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00885}00885\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00886}00886\ \ \ \ \ \ \ pDst\ =\ (pRing-\/>pBuffer\ +\ pRing-\/>WrOff)\ +\ SEGGER\_RTT\_UNCACHED\_OFF;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00887}00887\ \textcolor{preprocessor}{\#if\ SEGGER\_RTT\_MEMCPY\_USE\_BYTELOOP}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00888}00888\ \ \ \ \ \ \ NumBytes\ -\/=\ Avail;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00889}00889\ \ \ \ \ \ \ \textcolor{keywordflow}{while}\ (Avail-\/-\/)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00890}00890\ \ \ \ \ \ \ \ \ *pDst++\ =\ *pData++;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00891}00891\ \ \ \ \ \ \ \};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00892}00892\ \ \ \ \ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ data\ write\ to\ be\ complete\ before\ writing\ the\ <WrOff>,\ in\ case\ CPU\ is\ allowed\ to\ change\ the\ order\ of\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00893}00893\ \ \ \ \ \ \ pRing-\/>WrOff\ =\ 0;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00894}00894\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00895}00895\ \ \ \ \ \ \ SEGGER\_RTT\_MEMCPY((\textcolor{keywordtype}{void}*)pDst,\ pData,\ Avail);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00896}00896\ \ \ \ \ \ \ pData\ +=\ Avail;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00897}00897\ \ \ \ \ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ data\ write\ to\ be\ complete\ before\ writing\ the\ <WrOff>,\ in\ case\ CPU\ is\ allowed\ to\ change\ the\ order\ of\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00898}00898\ \ \ \ \ \ \ pRing-\/>WrOff\ =\ 0;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00899}00899\ \ \ \ \ \ \ NumBytes\ -\/=\ Avail;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00900}00900\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00901}00901\ \ \ \ \ \ \ Avail\ =\ (pRing-\/>SizeOfBuffer\ -\/\ 1);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00902}00902\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00903}00903\ \ \ \}\ \textcolor{keywordflow}{while}\ (NumBytes);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00904}00904\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00905}00905\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00906}00906\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00907}00907\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00908}00908\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_WriteSkipNoLock}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00909}00909\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00910}00910\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00911}00911\ \textcolor{comment}{*\ \ \ \ Stores\ a\ specified\ number\ of\ characters\ in\ SEGGER\ RTT}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00912}00912\ \textcolor{comment}{*\ \ \ \ control\ block\ which\ is\ then\ read\ by\ the\ host.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00913}00913\ \textcolor{comment}{*\ \ \ \ SEGGER\_RTT\_WriteSkipNoLock\ does\ not\ lock\ the\ application\ and}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00914}00914\ \textcolor{comment}{*\ \ \ \ skips\ all\ data,\ if\ the\ data\ does\ not\ fit\ into\ the\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00915}00915\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00916}00916\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00917}00917\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ "{}Up"{}-\/buffer\ to\ be\ used\ (e.g.\ 0\ for\ "{}Terminal"{}).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00918}00918\ \textcolor{comment}{*\ \ \ \ pBuffer\ \ \ \ \ \ Pointer\ to\ character\ array.\ Does\ not\ need\ to\ point\ to\ a\ \(\backslash\)0\ terminated\ string.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00919}00919\ \textcolor{comment}{*\ \ \ \ NumBytes\ \ \ \ \ Number\ of\ bytes\ to\ be\ stored\ in\ the\ SEGGER\ RTT\ control\ block.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00920}00920\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ MUST\ be\ >\ 0!!!}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00921}00921\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ This\ is\ done\ for\ performance\ reasons,\ so\ no\ initial\ check\ has\ do\ be\ done.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00922}00922\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00923}00923\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00924}00924\ \textcolor{comment}{*\ \ \ \ 1:\ Data\ has\ been\ copied}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00925}00925\ \textcolor{comment}{*\ \ \ \ 0:\ No\ space,\ data\ has\ not\ been\ copied}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00926}00926\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00927}00927\ \textcolor{comment}{*\ \ Notes}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00928}00928\ \textcolor{comment}{*\ \ \ \ (1)\ If\ there\ is\ not\ enough\ space\ in\ the\ "{}Up"{}-\/buffer,\ all\ data\ is\ dropped.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00929}00929\ \textcolor{comment}{*\ \ \ \ (2)\ For\ performance\ reasons\ this\ function\ does\ not\ call\ Init()}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00930}00930\ \textcolor{comment}{*\ \ \ \ \ \ \ \ and\ may\ only\ be\ called\ after\ RTT\ has\ been\ initialized.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00931}00931\ \textcolor{comment}{*\ \ \ \ \ \ \ \ Either\ by\ calling\ SEGGER\_RTT\_Init()\ or\ calling\ another\ RTT\ API\ function\ first.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00932}00932\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00933}00933\ \textcolor{preprocessor}{\#if\ (RTT\_USE\_ASM\ ==\ 0)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00934}00934\ \textcolor{keywordtype}{unsigned}\ SEGGER\_RTT\_WriteSkipNoLock(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{void}*\ pBuffer,\ \textcolor{keywordtype}{unsigned}\ NumBytes)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00935}00935\ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ \ \ \ \ \ \ \ \ \ \ pData;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00936}00936\ \ \ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*\ pRing;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00937}00937\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ Avail;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00938}00938\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00939}00939\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00940}00940\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ Rem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00941}00941\ \ \ \textcolor{keyword}{volatile}\ \textcolor{keywordtype}{char}*\ \ \ \ \ \ \ \ pDst;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00942}00942\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00943}00943\ \ \ \textcolor{comment}{//\ Cases:}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00944}00944\ \ \ \textcolor{comment}{//\ \ \ 1)\ RdOff\ <=\ WrOff\ =>\ Space\ until\ wrap-\/around\ is\ sufficient}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00945}00945\ \ \ \textcolor{comment}{//\ \ \ 2)\ RdOff\ <=\ WrOff\ =>\ Space\ after\ wrap-\/around\ needed\ (copy\ in\ 2\ chunks)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00946}00946\ \ \ \textcolor{comment}{//\ \ \ 3)\ RdOff\ <\ \ WrOff\ =>\ No\ space\ in\ buf}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00947}00947\ \ \ \textcolor{comment}{//\ \ \ 4)\ RdOff\ >\ \ WrOff\ =>\ Space\ is\ sufficient}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00948}00948\ \ \ \textcolor{comment}{//\ \ \ 5)\ RdOff\ >\ \ WrOff\ =>\ No\ space\ in\ buf}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00949}00949\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00950}00950\ \ \ \textcolor{comment}{//\ 1)\ is\ the\ most\ common\ case\ for\ large\ buffers\ and\ assuming\ that\ J-\/Link\ reads\ the\ data\ fast\ enough}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00951}00951\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00952}00952\ \ \ pData\ =\ (\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *)pBuffer;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00953}00953\ \ \ pRing\ =\ (\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*)((uintptr\_t)\&\_SEGGER\_RTT.aUp[BufferIndex]\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00954}00954\ \ \ RdOff\ =\ pRing-\/>RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00955}00955\ \ \ WrOff\ =\ pRing-\/>WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00956}00956\ \ \ pDst\ =\ (pRing-\/>pBuffer\ +\ WrOff)\ +\ SEGGER\_RTT\_UNCACHED\_OFF;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00957}00957\ \ \ \textcolor{keywordflow}{if}\ (RdOff\ <=\ WrOff)\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Case\ 1),\ 2)\ or\ 3)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00958}00958\ \ \ \ \ Avail\ =\ pRing-\/>SizeOfBuffer\ -\/\ WrOff\ -\/\ 1u;\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Space\ until\ wrap-\/around\ (assume\ 1\ byte\ not\ usable\ for\ case\ that\ RdOff\ ==\ 0)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00959}00959\ \ \ \ \ \textcolor{keywordflow}{if}\ (Avail\ >=\ NumBytes)\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Case\ 1)?}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00960}00960\ \ \ \ \ \ \ memcpy((\textcolor{keywordtype}{void}*)pDst,\ pData,\ NumBytes);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00961}00961\ \ \ \ \ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ data\ write\ to\ be\ complete\ before\ writing\ the\ <WrOff>,\ in\ case\ CPU\ is\ allowed\ to\ change\ the\ order\ of\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00962}00962\ \ \ \ \ \ \ pRing-\/>WrOff\ =\ WrOff\ +\ NumBytes;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00963}00963\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ 1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00964}00964\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00965}00965\ \ \ \ \ Avail\ +=\ RdOff;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Space\ incl.\ wrap-\/around}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00966}00966\ \ \ \ \ \textcolor{keywordflow}{if}\ (Avail\ >=\ NumBytes)\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Case\ 2?\ =>\ If\ not,\ we\ have\ case\ 3)\ (does\ not\ fit)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00967}00967\ \ \ \ \ \ \ Rem\ =\ pRing-\/>SizeOfBuffer\ -\/\ WrOff;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Space\ until\ end\ of\ buffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00968}00968\ \ \ \ \ \ \ memcpy((\textcolor{keywordtype}{void}*)pDst,\ pData,\ Rem);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Copy\ 1st\ chunk}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00969}00969\ \ \ \ \ \ \ NumBytes\ -\/=\ Rem;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00970}00970\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00971}00971\ \ \ \ \ \ \ \textcolor{comment}{//\ Special\ case:\ First\ check\ that\ assumed\ RdOff\ ==\ 0\ calculated\ that\ last\ element\ before\ wrap-\/around\ could\ not\ be\ used}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00972}00972\ \ \ \ \ \ \ \textcolor{comment}{//\ But\ 2nd\ check\ (considering\ space\ until\ wrap-\/around\ and\ until\ RdOff)\ revealed\ that\ RdOff\ is\ not\ 0,\ so\ we\ can\ use\ the\ last\ element}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00973}00973\ \ \ \ \ \ \ \textcolor{comment}{//\ In\ this\ case,\ we\ may\ use\ a\ copy\ straight\ until\ buffer\ end\ anyway\ without\ needing\ to\ copy\ 2\ chunks}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00974}00974\ \ \ \ \ \ \ \textcolor{comment}{//\ Therefore,\ check\ if\ 2nd\ memcpy\ is\ necessary\ at\ all}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00975}00975\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00976}00976\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (NumBytes)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00977}00977\ \ \ \ \ \ \ \ \ pDst\ =\ pRing-\/>pBuffer\ +\ SEGGER\_RTT\_UNCACHED\_OFF;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00978}00978\ \ \ \ \ \ \ \ \ memcpy((\textcolor{keywordtype}{void}*)pDst,\ pData\ +\ Rem,\ NumBytes);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00979}00979\ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00980}00980\ \ \ \ \ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ data\ write\ to\ be\ complete\ before\ writing\ the\ <WrOff>,\ in\ case\ CPU\ is\ allowed\ to\ change\ the\ order\ of\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00981}00981\ \ \ \ \ \ \ pRing-\/>WrOff\ =\ NumBytes;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00982}00982\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ 1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00983}00983\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00984}00984\ \ \ \}\ \textcolor{keywordflow}{else}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Potential\ case\ 4)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00985}00985\ \ \ \ \ Avail\ =\ RdOff\ -\/\ WrOff\ -\/\ 1u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00986}00986\ \ \ \ \ \textcolor{keywordflow}{if}\ (Avail\ >=\ NumBytes)\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Case\ 4)?\ =>\ If\ not,\ we\ have\ case\ 5)\ (does\ not\ fit)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00987}00987\ \ \ \ \ \ \ memcpy((\textcolor{keywordtype}{void}*)pDst,\ pData,\ NumBytes);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00988}00988\ \ \ \ \ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ data\ write\ to\ be\ complete\ before\ writing\ the\ <WrOff>,\ in\ case\ CPU\ is\ allowed\ to\ change\ the\ order\ of\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00989}00989\ \ \ \ \ \ \ pRing-\/>WrOff\ =\ WrOff\ +\ NumBytes;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00990}00990\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ 1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00991}00991\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00992}00992\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00993}00993\ \ \ \textcolor{keywordflow}{return}\ 0;\ \ \ \ \ \textcolor{comment}{//\ No\ space\ in\ buffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00994}00994\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00995}00995\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00996}00996\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00997}00997\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00998}00998\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l00999}00999\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_WriteDownBufferNoLock}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01000}01000\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01001}01001\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01002}01002\ \textcolor{comment}{*\ \ \ \ Stores\ a\ specified\ number\ of\ characters\ in\ SEGGER\ RTT}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01003}01003\ \textcolor{comment}{*\ \ \ \ control\ block\ inside\ a\ <Down>\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01004}01004\ \textcolor{comment}{*\ \ \ \ SEGGER\_RTT\_WriteDownBufferNoLock\ does\ not\ lock\ the\ application.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01005}01005\ \textcolor{comment}{*\ \ \ \ Used\ to\ do\ the\ same\ operation\ that\ J-\/Link\ does,\ to\ transfer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01006}01006\ \textcolor{comment}{*\ \ \ \ RTT\ data\ from\ other\ channels,\ such\ as\ TCP/IP\ or\ UART.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01007}01007\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01008}01008\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01009}01009\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ "{}Down"{}-\/buffer\ to\ be\ used.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01010}01010\ \textcolor{comment}{*\ \ \ \ pBuffer\ \ \ \ \ \ Pointer\ to\ character\ array.\ Does\ not\ need\ to\ point\ to\ a\ \(\backslash\)0\ terminated\ string.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01011}01011\ \textcolor{comment}{*\ \ \ \ NumBytes\ \ \ \ \ Number\ of\ bytes\ to\ be\ stored\ in\ the\ SEGGER\ RTT\ control\ block.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01012}01012\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01013}01013\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01014}01014\ \textcolor{comment}{*\ \ \ \ Number\ of\ bytes\ which\ have\ been\ stored\ in\ the\ "{}Down"{}-\/buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01015}01015\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01016}01016\ \textcolor{comment}{*\ \ Notes}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01017}01017\ \textcolor{comment}{*\ \ \ \ (1)\ Data\ is\ stored\ according\ to\ buffer\ flags.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01018}01018\ \textcolor{comment}{*\ \ \ \ (2)\ For\ performance\ reasons\ this\ function\ does\ not\ call\ Init()}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01019}01019\ \textcolor{comment}{*\ \ \ \ \ \ \ \ and\ may\ only\ be\ called\ after\ RTT\ has\ been\ initialized.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01020}01020\ \textcolor{comment}{*\ \ \ \ \ \ \ \ Either\ by\ calling\ SEGGER\_RTT\_Init()\ or\ calling\ another\ RTT\ API\ function\ first.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01021}01021\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01022}01022\ \textcolor{comment}{*\ \ Additional\ information}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01023}01023\ \textcolor{comment}{*\ \ \ \ This\ function\ must\ not\ be\ called\ when\ J-\/Link\ might\ also\ do\ RTT.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01024}01024\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01025}01025\ \textcolor{keywordtype}{unsigned}\ SEGGER\_RTT\_WriteDownBufferNoLock(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{void}*\ pBuffer,\ \textcolor{keywordtype}{unsigned}\ NumBytes)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01026}01026\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Status;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01027}01027\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Avail;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01028}01028\ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ \ \ \ \ \ \ \ \ \ \ \ \ pData;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01029}01029\ \ \ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*\ \ \ pRing;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01030}01030\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01031}01031\ \ \ \textcolor{comment}{//\ Get\ "{}to-\/target"{}\ ring\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01032}01032\ \ \ \textcolor{comment}{//\ It\ is\ save\ to\ cast\ that\ to\ a\ "{}to-\/host"{}\ buffer.\ Up\ and\ Down\ buffer\ differ\ in\ volatility\ of\ offsets\ that\ might\ be\ modified\ by\ J-\/Link.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01033}01033\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01034}01034\ \ \ pData\ =\ (\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *)pBuffer;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01035}01035\ \ \ pRing\ =\ (\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*)((uintptr\_t)\&\_SEGGER\_RTT.aDown[BufferIndex]\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01036}01036\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01037}01037\ \ \ \textcolor{comment}{//\ How\ we\ output\ depends\ upon\ the\ mode...}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01038}01038\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01039}01039\ \ \ \textcolor{keywordflow}{switch}\ (pRing-\/>Flags)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01040}01040\ \ \ \textcolor{keywordflow}{case}\ SEGGER\_RTT\_MODE\_NO\_BLOCK\_SKIP:}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01041}01041\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01042}01042\ \ \ \ \ \textcolor{comment}{//\ If\ we\ are\ in\ skip\ mode\ and\ there\ is\ no\ space\ for\ the\ whole}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01043}01043\ \ \ \ \ \textcolor{comment}{//\ of\ this\ output,\ don't\ bother.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01044}01044\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01045}01045\ \ \ \ \ Avail\ =\ \_GetAvailWriteSpace(pRing);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01046}01046\ \ \ \ \ \textcolor{keywordflow}{if}\ (Avail\ <\ NumBytes)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01047}01047\ \ \ \ \ \ \ Status\ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01048}01048\ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01049}01049\ \ \ \ \ \ \ Status\ =\ NumBytes;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01050}01050\ \ \ \ \ \ \ \_WriteNoCheck(pRing,\ pData,\ NumBytes);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01051}01051\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01052}01052\ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01053}01053\ \ \ \textcolor{keywordflow}{case}\ SEGGER\_RTT\_MODE\_NO\_BLOCK\_TRIM:}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01054}01054\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01055}01055\ \ \ \ \ \textcolor{comment}{//\ If\ we\ are\ in\ trim\ mode,\ trim\ to\ what\ we\ can\ output\ without\ blocking.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01056}01056\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01057}01057\ \ \ \ \ Avail\ =\ \_GetAvailWriteSpace(pRing);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01058}01058\ \ \ \ \ Status\ =\ Avail\ <\ NumBytes\ ?\ Avail\ :\ NumBytes;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01059}01059\ \ \ \ \ \_WriteNoCheck(pRing,\ pData,\ Status);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01060}01060\ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01061}01061\ \ \ \textcolor{keywordflow}{case}\ SEGGER\_RTT\_MODE\_BLOCK\_IF\_FIFO\_FULL:}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01062}01062\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01063}01063\ \ \ \ \ \textcolor{comment}{//\ If\ we\ are\ in\ blocking\ mode,\ output\ everything.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01064}01064\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01065}01065\ \ \ \ \ Status\ =\ \_WriteBlocking(pRing,\ pData,\ NumBytes);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01066}01066\ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01067}01067\ \ \ \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01068}01068\ \ \ \ \ Status\ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01069}01069\ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01070}01070\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01071}01071\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01072}01072\ \ \ \textcolor{comment}{//\ Finish\ up.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01073}01073\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01074}01074\ \ \ \textcolor{keywordflow}{return}\ Status;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01075}01075\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01076}01076\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01077}01077\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01078}01078\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01079}01079\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_WriteNoLock}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01080}01080\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01081}01081\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01082}01082\ \textcolor{comment}{*\ \ \ \ Stores\ a\ specified\ number\ of\ characters\ in\ SEGGER\ RTT}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01083}01083\ \textcolor{comment}{*\ \ \ \ control\ block\ which\ is\ then\ read\ by\ the\ host.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01084}01084\ \textcolor{comment}{*\ \ \ \ SEGGER\_RTT\_WriteNoLock\ does\ not\ lock\ the\ application.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01085}01085\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01086}01086\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01087}01087\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ "{}Up"{}-\/buffer\ to\ be\ used\ (e.g.\ 0\ for\ "{}Terminal"{}).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01088}01088\ \textcolor{comment}{*\ \ \ \ pBuffer\ \ \ \ \ \ Pointer\ to\ character\ array.\ Does\ not\ need\ to\ point\ to\ a\ \(\backslash\)0\ terminated\ string.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01089}01089\ \textcolor{comment}{*\ \ \ \ NumBytes\ \ \ \ \ Number\ of\ bytes\ to\ be\ stored\ in\ the\ SEGGER\ RTT\ control\ block.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01090}01090\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01091}01091\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01092}01092\ \textcolor{comment}{*\ \ \ \ Number\ of\ bytes\ which\ have\ been\ stored\ in\ the\ "{}Up"{}-\/buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01093}01093\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01094}01094\ \textcolor{comment}{*\ \ Notes}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01095}01095\ \textcolor{comment}{*\ \ \ \ (1)\ Data\ is\ stored\ according\ to\ buffer\ flags.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01096}01096\ \textcolor{comment}{*\ \ \ \ (2)\ For\ performance\ reasons\ this\ function\ does\ not\ call\ Init()}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01097}01097\ \textcolor{comment}{*\ \ \ \ \ \ \ \ and\ may\ only\ be\ called\ after\ RTT\ has\ been\ initialized.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01098}01098\ \textcolor{comment}{*\ \ \ \ \ \ \ \ Either\ by\ calling\ SEGGER\_RTT\_Init()\ or\ calling\ another\ RTT\ API\ function\ first.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01099}01099\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01100}01100\ \textcolor{keywordtype}{unsigned}\ SEGGER\_RTT\_WriteNoLock(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{void}*\ pBuffer,\ \textcolor{keywordtype}{unsigned}\ NumBytes)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01101}01101\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ Status;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01102}01102\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ Avail;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01103}01103\ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ \ \ \ \ \ \ \ \ \ \ pData;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01104}01104\ \ \ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*\ pRing;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01105}01105\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01106}01106\ \ \ \textcolor{comment}{//\ Get\ "{}to-\/host"{}\ ring\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01107}01107\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01108}01108\ \ \ pData\ =\ (\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *)pBuffer;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01109}01109\ \ \ pRing\ =\ (\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*)((uintptr\_t)\&\_SEGGER\_RTT.aUp[BufferIndex]\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01110}01110\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01111}01111\ \ \ \textcolor{comment}{//\ How\ we\ output\ depends\ upon\ the\ mode...}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01112}01112\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01113}01113\ \ \ \textcolor{keywordflow}{switch}\ (pRing-\/>Flags)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01114}01114\ \ \ \textcolor{keywordflow}{case}\ SEGGER\_RTT\_MODE\_NO\_BLOCK\_SKIP:}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01115}01115\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01116}01116\ \ \ \ \ \textcolor{comment}{//\ If\ we\ are\ in\ skip\ mode\ and\ there\ is\ no\ space\ for\ the\ whole}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01117}01117\ \ \ \ \ \textcolor{comment}{//\ of\ this\ output,\ don't\ bother.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01118}01118\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01119}01119\ \ \ \ \ Avail\ =\ \_GetAvailWriteSpace(pRing);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01120}01120\ \ \ \ \ \textcolor{keywordflow}{if}\ (Avail\ <\ NumBytes)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01121}01121\ \ \ \ \ \ \ Status\ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01122}01122\ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01123}01123\ \ \ \ \ \ \ Status\ =\ NumBytes;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01124}01124\ \ \ \ \ \ \ \_WriteNoCheck(pRing,\ pData,\ NumBytes);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01125}01125\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01126}01126\ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01127}01127\ \ \ \textcolor{keywordflow}{case}\ SEGGER\_RTT\_MODE\_NO\_BLOCK\_TRIM:}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01128}01128\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01129}01129\ \ \ \ \ \textcolor{comment}{//\ If\ we\ are\ in\ trim\ mode,\ trim\ to\ what\ we\ can\ output\ without\ blocking.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01130}01130\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01131}01131\ \ \ \ \ Avail\ =\ \_GetAvailWriteSpace(pRing);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01132}01132\ \ \ \ \ Status\ =\ Avail\ <\ NumBytes\ ?\ Avail\ :\ NumBytes;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01133}01133\ \ \ \ \ \_WriteNoCheck(pRing,\ pData,\ Status);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01134}01134\ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01135}01135\ \ \ \textcolor{keywordflow}{case}\ SEGGER\_RTT\_MODE\_BLOCK\_IF\_FIFO\_FULL:}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01136}01136\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01137}01137\ \ \ \ \ \textcolor{comment}{//\ If\ we\ are\ in\ blocking\ mode,\ output\ everything.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01138}01138\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01139}01139\ \ \ \ \ Status\ =\ \_WriteBlocking(pRing,\ pData,\ NumBytes);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01140}01140\ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01141}01141\ \ \ \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01142}01142\ \ \ \ \ Status\ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01143}01143\ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01144}01144\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01145}01145\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01146}01146\ \ \ \textcolor{comment}{//\ Finish\ up.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01147}01147\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01148}01148\ \ \ \textcolor{keywordflow}{return}\ Status;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01149}01149\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01150}01150\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01151}01151\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01152}01152\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01153}01153\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_WriteDownBuffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01154}01154\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01155}01155\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01156}01156\ \textcolor{comment}{*\ \ \ \ Stores\ a\ specified\ number\ of\ characters\ in\ SEGGER\ RTT\ control\ block\ in\ a\ <Down>\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01157}01157\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01158}01158\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01159}01159\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ "{}Up"{}-\/buffer\ to\ be\ used\ (e.g.\ 0\ for\ "{}Terminal"{}).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01160}01160\ \textcolor{comment}{*\ \ \ \ pBuffer\ \ \ \ \ \ Pointer\ to\ character\ array.\ Does\ not\ need\ to\ point\ to\ a\ \(\backslash\)0\ terminated\ string.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01161}01161\ \textcolor{comment}{*\ \ \ \ NumBytes\ \ \ \ \ Number\ of\ bytes\ to\ be\ stored\ in\ the\ SEGGER\ RTT\ control\ block.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01162}01162\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01163}01163\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01164}01164\ \textcolor{comment}{*\ \ \ \ Number\ of\ bytes\ which\ have\ been\ stored\ in\ the\ "{}Down"{}-\/buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01165}01165\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01166}01166\ \textcolor{comment}{*\ \ Notes}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01167}01167\ \textcolor{comment}{*\ \ \ \ (1)\ Data\ is\ stored\ according\ to\ buffer\ flags.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01168}01168\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01169}01169\ \textcolor{comment}{*\ \ Additional\ information}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01170}01170\ \textcolor{comment}{*\ \ \ \ This\ function\ must\ not\ be\ called\ when\ J-\/Link\ might\ also\ do\ RTT.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01171}01171\ \textcolor{comment}{*\ \ \ \ This\ function\ locks\ against\ all\ other\ RTT\ operations.\ I.e.\ during}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01172}01172\ \textcolor{comment}{*\ \ \ \ the\ write\ operation,\ writing\ from\ the\ application\ is\ also\ locked.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01173}01173\ \textcolor{comment}{*\ \ \ \ If\ only\ one\ consumer\ writes\ to\ the\ down\ buffer,}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01174}01174\ \textcolor{comment}{*\ \ \ \ call\ SEGGER\_RTT\_WriteDownBufferNoLock()\ instead.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01175}01175\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01176}01176\ \textcolor{keywordtype}{unsigned}\ SEGGER\_RTT\_WriteDownBuffer(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{void}*\ pBuffer,\ \textcolor{keywordtype}{unsigned}\ NumBytes)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01177}01177\ \ \ \textcolor{keywordtype}{unsigned}\ Status;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01178}01178\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01179}01179\ \ \ INIT();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01180}01180\ \ \ SEGGER\_RTT\_LOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01181}01181\ \ \ Status\ =\ SEGGER\_RTT\_WriteDownBufferNoLock(BufferIndex,\ pBuffer,\ NumBytes);\ \ \textcolor{comment}{//\ Call\ the\ non-\/locking\ write\ function}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01182}01182\ \ \ SEGGER\_RTT\_UNLOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01183}01183\ \ \ \textcolor{keywordflow}{return}\ Status;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01184}01184\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01185}01185\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01186}01186\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01187}01187\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01188}01188\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_Write}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01189}01189\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01190}01190\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01191}01191\ \textcolor{comment}{*\ \ \ \ Stores\ a\ specified\ number\ of\ characters\ in\ SEGGER\ RTT}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01192}01192\ \textcolor{comment}{*\ \ \ \ control\ block\ which\ is\ then\ read\ by\ the\ host.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01193}01193\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01194}01194\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01195}01195\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ "{}Up"{}-\/buffer\ to\ be\ used\ (e.g.\ 0\ for\ "{}Terminal"{}).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01196}01196\ \textcolor{comment}{*\ \ \ \ pBuffer\ \ \ \ \ \ Pointer\ to\ character\ array.\ Does\ not\ need\ to\ point\ to\ a\ \(\backslash\)0\ terminated\ string.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01197}01197\ \textcolor{comment}{*\ \ \ \ NumBytes\ \ \ \ \ Number\ of\ bytes\ to\ be\ stored\ in\ the\ SEGGER\ RTT\ control\ block.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01198}01198\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01199}01199\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01200}01200\ \textcolor{comment}{*\ \ \ \ Number\ of\ bytes\ which\ have\ been\ stored\ in\ the\ "{}Up"{}-\/buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01201}01201\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01202}01202\ \textcolor{comment}{*\ \ Notes}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01203}01203\ \textcolor{comment}{*\ \ \ \ (1)\ Data\ is\ stored\ according\ to\ buffer\ flags.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01204}01204\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01205}01205\ \textcolor{keywordtype}{unsigned}\ SEGGER\_RTT\_Write(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{void}*\ pBuffer,\ \textcolor{keywordtype}{unsigned}\ NumBytes)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01206}01206\ \ \ \textcolor{keywordtype}{unsigned}\ Status;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01207}01207\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01208}01208\ \ \ INIT();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01209}01209\ \ \ SEGGER\_RTT\_LOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01210}01210\ \ \ Status\ =\ SEGGER\_RTT\_WriteNoLock(BufferIndex,\ pBuffer,\ NumBytes);\ \ \textcolor{comment}{//\ Call\ the\ non-\/locking\ write\ function}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01211}01211\ \ \ SEGGER\_RTT\_UNLOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01212}01212\ \ \ \textcolor{keywordflow}{return}\ Status;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01213}01213\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01214}01214\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01215}01215\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01216}01216\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01217}01217\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_WriteString}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01218}01218\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01219}01219\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01220}01220\ \textcolor{comment}{*\ \ \ \ Stores\ string\ in\ SEGGER\ RTT\ control\ block.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01221}01221\ \textcolor{comment}{*\ \ \ \ This\ data\ is\ read\ by\ the\ host.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01222}01222\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01223}01223\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01224}01224\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ "{}Up"{}-\/buffer\ to\ be\ used\ (e.g.\ 0\ for\ "{}Terminal"{}).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01225}01225\ \textcolor{comment}{*\ \ \ \ s\ \ \ \ \ \ \ \ \ \ \ \ Pointer\ to\ string.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01226}01226\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01227}01227\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01228}01228\ \textcolor{comment}{*\ \ \ \ Number\ of\ bytes\ which\ have\ been\ stored\ in\ the\ "{}Up"{}-\/buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01229}01229\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01230}01230\ \textcolor{comment}{*\ \ Notes}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01231}01231\ \textcolor{comment}{*\ \ \ \ (1)\ Data\ is\ stored\ according\ to\ buffer\ flags.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01232}01232\ \textcolor{comment}{*\ \ \ \ (2)\ String\ passed\ to\ this\ function\ has\ to\ be\ \(\backslash\)0\ terminated}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01233}01233\ \textcolor{comment}{*\ \ \ \ (3)\ \(\backslash\)0\ termination\ character\ is\ *not*\ stored\ in\ RTT\ buffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01234}01234\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01235}01235\ \textcolor{keywordtype}{unsigned}\ SEGGER\_RTT\_WriteString(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ s)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01236}01236\ \ \ \textcolor{keywordtype}{unsigned}\ Len;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01237}01237\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01238}01238\ \ \ Len\ =\ STRLEN(s);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01239}01239\ \ \ \textcolor{keywordflow}{return}\ SEGGER\_RTT\_Write(BufferIndex,\ s,\ Len);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01240}01240\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01241}01241\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01242}01242\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01243}01243\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01244}01244\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_PutCharSkipNoLock}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01245}01245\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01246}01246\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01247}01247\ \textcolor{comment}{*\ \ \ \ Stores\ a\ single\ character/byte\ in\ SEGGER\ RTT\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01248}01248\ \textcolor{comment}{*\ \ \ \ SEGGER\_RTT\_PutCharSkipNoLock\ does\ not\ lock\ the\ application\ and}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01249}01249\ \textcolor{comment}{*\ \ \ \ skips\ the\ byte,\ if\ it\ does\ not\ fit\ into\ the\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01250}01250\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01251}01251\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01252}01252\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ "{}Up"{}-\/buffer\ to\ be\ used\ (e.g.\ 0\ for\ "{}Terminal"{}).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01253}01253\ \textcolor{comment}{*\ \ \ \ c\ \ \ \ \ \ \ \ \ \ \ \ Byte\ to\ be\ stored.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01254}01254\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01255}01255\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01256}01256\ \textcolor{comment}{*\ \ \ \ Number\ of\ bytes\ which\ have\ been\ stored\ in\ the\ "{}Up"{}-\/buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01257}01257\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01258}01258\ \textcolor{comment}{*\ \ Notes}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01259}01259\ \textcolor{comment}{*\ \ \ \ (1)\ If\ there\ is\ not\ enough\ space\ in\ the\ "{}Up"{}-\/buffer,\ the\ character\ is\ dropped.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01260}01260\ \textcolor{comment}{*\ \ \ \ (2)\ For\ performance\ reasons\ this\ function\ does\ not\ call\ Init()}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01261}01261\ \textcolor{comment}{*\ \ \ \ \ \ \ \ and\ may\ only\ be\ called\ after\ RTT\ has\ been\ initialized.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01262}01262\ \textcolor{comment}{*\ \ \ \ \ \ \ \ Either\ by\ calling\ SEGGER\_RTT\_Init()\ or\ calling\ another\ RTT\ API\ function\ first.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01263}01263\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01264}01264\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01265}01265\ \textcolor{keywordtype}{unsigned}\ SEGGER\_RTT\_PutCharSkipNoLock(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keywordtype}{char}\ c)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01266}01266\ \ \ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*\ pRing;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01267}01267\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01268}01268\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ Status;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01269}01269\ \ \ \textcolor{keyword}{volatile}\ \textcolor{keywordtype}{char}*\ \ \ \ \ \ \ \ pDst;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01270}01270\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01271}01271\ \ \ \textcolor{comment}{//\ Get\ "{}to-\/host"{}\ ring\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01272}01272\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01273}01273\ \ \ pRing\ =\ (\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*)((uintptr\_t)\&\_SEGGER\_RTT.aUp[BufferIndex]\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01274}01274\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01275}01275\ \ \ \textcolor{comment}{//\ Get\ write\ position\ and\ handle\ wrap-\/around\ if\ necessary}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01276}01276\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01277}01277\ \ \ WrOff\ =\ pRing-\/>WrOff\ +\ 1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01278}01278\ \ \ \textcolor{keywordflow}{if}\ (WrOff\ ==\ pRing-\/>SizeOfBuffer)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01279}01279\ \ \ \ \ WrOff\ =\ 0;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01280}01280\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01281}01281\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01282}01282\ \ \ \textcolor{comment}{//\ Output\ byte\ if\ free\ space\ is\ available}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01283}01283\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01284}01284\ \ \ \textcolor{keywordflow}{if}\ (WrOff\ !=\ pRing-\/>RdOff)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01285}01285\ \ \ \ \ pDst\ =\ (pRing-\/>pBuffer\ +\ pRing-\/>WrOff)\ +\ SEGGER\_RTT\_UNCACHED\_OFF;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01286}01286\ \ \ \ \ *pDst\ =\ c;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01287}01287\ \ \ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ data\ write\ to\ be\ complete\ before\ writing\ the\ <WrOff>,\ in\ case\ CPU\ is\ allowed\ to\ change\ the\ order\ of\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01288}01288\ \ \ \ \ pRing-\/>WrOff\ =\ WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01289}01289\ \ \ \ \ Status\ =\ 1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01290}01290\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01291}01291\ \ \ \ \ Status\ =\ 0;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01292}01292\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01293}01293\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01294}01294\ \ \ \textcolor{keywordflow}{return}\ Status;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01295}01295\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01296}01296\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01297}01297\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01298}01298\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01299}01299\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_PutCharSkip}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01300}01300\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01301}01301\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01302}01302\ \textcolor{comment}{*\ \ \ \ Stores\ a\ single\ character/byte\ in\ SEGGER\ RTT\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01303}01303\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01304}01304\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01305}01305\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ "{}Up"{}-\/buffer\ to\ be\ used\ (e.g.\ 0\ for\ "{}Terminal"{}).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01306}01306\ \textcolor{comment}{*\ \ \ \ c\ \ \ \ \ \ \ \ \ \ \ \ Byte\ to\ be\ stored.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01307}01307\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01308}01308\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01309}01309\ \textcolor{comment}{*\ \ \ \ Number\ of\ bytes\ which\ have\ been\ stored\ in\ the\ "{}Up"{}-\/buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01310}01310\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01311}01311\ \textcolor{comment}{*\ \ Notes}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01312}01312\ \textcolor{comment}{*\ \ \ \ (1)\ If\ there\ is\ not\ enough\ space\ in\ the\ "{}Up"{}-\/buffer,\ the\ character\ is\ dropped.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01313}01313\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01314}01314\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01315}01315\ \textcolor{keywordtype}{unsigned}\ SEGGER\_RTT\_PutCharSkip(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keywordtype}{char}\ c)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01316}01316\ \ \ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*\ pRing;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01317}01317\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01318}01318\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ Status;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01319}01319\ \ \ \textcolor{keyword}{volatile}\ \textcolor{keywordtype}{char}*\ \ \ \ \ \ \ \ pDst;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01320}01320\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01321}01321\ \ \ \textcolor{comment}{//\ Prepare}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01322}01322\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01323}01323\ \ \ INIT();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01324}01324\ \ \ SEGGER\_RTT\_LOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01325}01325\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01326}01326\ \ \ \textcolor{comment}{//\ Get\ "{}to-\/host"{}\ ring\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01327}01327\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01328}01328\ \ \ pRing\ =\ (\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*)((uintptr\_t)\&\_SEGGER\_RTT.aUp[BufferIndex]\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01329}01329\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01330}01330\ \ \ \textcolor{comment}{//\ Get\ write\ position\ and\ handle\ wrap-\/around\ if\ necessary}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01331}01331\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01332}01332\ \ \ WrOff\ =\ pRing-\/>WrOff\ +\ 1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01333}01333\ \ \ \textcolor{keywordflow}{if}\ (WrOff\ ==\ pRing-\/>SizeOfBuffer)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01334}01334\ \ \ \ \ WrOff\ =\ 0;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01335}01335\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01336}01336\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01337}01337\ \ \ \textcolor{comment}{//\ Output\ byte\ if\ free\ space\ is\ available}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01338}01338\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01339}01339\ \ \ \textcolor{keywordflow}{if}\ (WrOff\ !=\ pRing-\/>RdOff)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01340}01340\ \ \ \ \ pDst\ \ =\ (pRing-\/>pBuffer\ +\ pRing-\/>WrOff)\ +\ SEGGER\_RTT\_UNCACHED\_OFF;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01341}01341\ \ \ \ \ *pDst\ =\ c;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01342}01342\ \ \ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ data\ write\ to\ be\ complete\ before\ writing\ the\ <WrOff>,\ in\ case\ CPU\ is\ allowed\ to\ change\ the\ order\ of\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01343}01343\ \ \ \ \ pRing-\/>WrOff\ =\ WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01344}01344\ \ \ \ \ Status\ =\ 1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01345}01345\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01346}01346\ \ \ \ \ Status\ =\ 0;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01347}01347\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01348}01348\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01349}01349\ \ \ \textcolor{comment}{//\ Finish\ up.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01350}01350\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01351}01351\ \ \ SEGGER\_RTT\_UNLOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01352}01352\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01353}01353\ \ \ \textcolor{keywordflow}{return}\ Status;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01354}01354\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01355}01355\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01356}01356\ \textcolor{comment}{\ /*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01357}01357\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01358}01358\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_PutChar}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01359}01359\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01360}01360\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01361}01361\ \textcolor{comment}{*\ \ \ \ Stores\ a\ single\ character/byte\ in\ SEGGER\ RTT\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01362}01362\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01363}01363\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01364}01364\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ "{}Up"{}-\/buffer\ to\ be\ used\ (e.g.\ 0\ for\ "{}Terminal"{}).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01365}01365\ \textcolor{comment}{*\ \ \ \ c\ \ \ \ \ \ \ \ \ \ \ \ Byte\ to\ be\ stored.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01366}01366\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01367}01367\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01368}01368\ \textcolor{comment}{*\ \ \ \ Number\ of\ bytes\ which\ have\ been\ stored\ in\ the\ "{}Up"{}-\/buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01369}01369\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01370}01370\ \textcolor{comment}{*\ \ Notes}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01371}01371\ \textcolor{comment}{*\ \ \ \ (1)\ Data\ is\ stored\ according\ to\ buffer\ flags.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01372}01372\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01373}01373\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01374}01374\ \textcolor{keywordtype}{unsigned}\ SEGGER\_RTT\_PutChar(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keywordtype}{char}\ c)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01375}01375\ \ \ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*\ pRing;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01376}01376\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01377}01377\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ Status;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01378}01378\ \ \ \textcolor{keyword}{volatile}\ \textcolor{keywordtype}{char}*\ \ \ \ \ \ \ \ pDst;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01379}01379\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01380}01380\ \ \ \textcolor{comment}{//\ Prepare}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01381}01381\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01382}01382\ \ \ INIT();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01383}01383\ \ \ SEGGER\_RTT\_LOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01384}01384\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01385}01385\ \ \ \textcolor{comment}{//\ Get\ "{}to-\/host"{}\ ring\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01386}01386\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01387}01387\ \ \ pRing\ =\ (\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*)((uintptr\_t)\&\_SEGGER\_RTT.aUp[BufferIndex]\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01388}01388\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01389}01389\ \ \ \textcolor{comment}{//\ Get\ write\ position\ and\ handle\ wrap-\/around\ if\ necessary}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01390}01390\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01391}01391\ \ \ WrOff\ =\ pRing-\/>WrOff\ +\ 1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01392}01392\ \ \ \textcolor{keywordflow}{if}\ (WrOff\ ==\ pRing-\/>SizeOfBuffer)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01393}01393\ \ \ \ \ WrOff\ =\ 0;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01394}01394\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01395}01395\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01396}01396\ \ \ \textcolor{comment}{//\ Wait\ for\ free\ space\ if\ mode\ is\ set\ to\ blocking}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01397}01397\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01398}01398\ \ \ \textcolor{keywordflow}{if}\ (pRing-\/>Flags\ ==\ SEGGER\_RTT\_MODE\_BLOCK\_IF\_FIFO\_FULL)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01399}01399\ \ \ \ \ \textcolor{keywordflow}{while}\ (WrOff\ ==\ pRing-\/>RdOff)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01400}01400\ \ \ \ \ \ \ ;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01401}01401\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01402}01402\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01403}01403\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01404}01404\ \ \ \textcolor{comment}{//\ Output\ byte\ if\ free\ space\ is\ available}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01405}01405\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01406}01406\ \ \ \textcolor{keywordflow}{if}\ (WrOff\ !=\ pRing-\/>RdOff)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01407}01407\ \ \ \ \ pDst\ \ =\ (pRing-\/>pBuffer\ +\ pRing-\/>WrOff)\ +\ SEGGER\_RTT\_UNCACHED\_OFF;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01408}01408\ \ \ \ \ *pDst\ =\ c;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01409}01409\ \ \ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ data\ write\ to\ be\ complete\ before\ writing\ the\ <WrOff>,\ in\ case\ CPU\ is\ allowed\ to\ change\ the\ order\ of\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01410}01410\ \ \ \ \ pRing-\/>WrOff\ =\ WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01411}01411\ \ \ \ \ Status\ =\ 1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01412}01412\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01413}01413\ \ \ \ \ Status\ =\ 0;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01414}01414\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01415}01415\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01416}01416\ \ \ \textcolor{comment}{//\ Finish\ up.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01417}01417\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01418}01418\ \ \ SEGGER\_RTT\_UNLOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01419}01419\ \ \ \textcolor{keywordflow}{return}\ Status;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01420}01420\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01421}01421\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01422}01422\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01423}01423\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01424}01424\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_GetKey}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01425}01425\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01426}01426\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01427}01427\ \textcolor{comment}{*\ \ \ \ Reads\ one\ character\ from\ the\ SEGGER\ RTT\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01428}01428\ \textcolor{comment}{*\ \ \ \ Host\ has\ previously\ stored\ data\ there.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01429}01429\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01430}01430\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01431}01431\ \textcolor{comment}{*\ \ \ \ <\ \ 0\ -\/\ \ \ No\ character\ available\ (buffer\ empty).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01432}01432\ \textcolor{comment}{*\ \ \ \ >=\ 0\ -\/\ \ \ Character\ which\ has\ been\ read.\ (Possible\ values:\ 0\ -\/\ 255)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01433}01433\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01434}01434\ \textcolor{comment}{*\ \ Notes}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01435}01435\ \textcolor{comment}{*\ \ \ \ (1)\ This\ function\ is\ only\ specified\ for\ accesses\ to\ RTT\ buffer\ 0.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01436}01436\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01437}01437\ \textcolor{keywordtype}{int}\ SEGGER\_RTT\_GetKey(\textcolor{keywordtype}{void})\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01438}01438\ \ \ \textcolor{keywordtype}{char}\ c;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01439}01439\ \ \ \textcolor{keywordtype}{int}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01440}01440\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01441}01441\ \ \ r\ =\ (int)SEGGER\_RTT\_Read(0u,\ \&c,\ 1u);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01442}01442\ \ \ \textcolor{keywordflow}{if}\ (r\ ==\ 1)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01443}01443\ \ \ \ \ r\ =\ (int)(\textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{char})c;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01444}01444\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01445}01445\ \ \ \ \ r\ =\ -\/1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01446}01446\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01447}01447\ \ \ \textcolor{keywordflow}{return}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01448}01448\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01449}01449\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01450}01450\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01451}01451\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01452}01452\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_WaitKey}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01453}01453\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01454}01454\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01455}01455\ \textcolor{comment}{*\ \ \ \ Waits\ until\ at\ least\ one\ character\ is\ avaible\ in\ the\ SEGGER\ RTT\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01456}01456\ \textcolor{comment}{*\ \ \ \ Once\ a\ character\ is\ available,\ it\ is\ read\ and\ this\ function\ returns.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01457}01457\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01458}01458\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01459}01459\ \textcolor{comment}{*\ \ \ \ >=0\ -\/\ \ \ Character\ which\ has\ been\ read.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01460}01460\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01461}01461\ \textcolor{comment}{*\ \ Notes}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01462}01462\ \textcolor{comment}{*\ \ \ \ (1)\ This\ function\ is\ only\ specified\ for\ accesses\ to\ RTT\ buffer\ 0}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01463}01463\ \textcolor{comment}{*\ \ \ \ (2)\ This\ function\ is\ blocking\ if\ no\ character\ is\ present\ in\ RTT\ buffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01464}01464\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01465}01465\ \textcolor{keywordtype}{int}\ SEGGER\_RTT\_WaitKey(\textcolor{keywordtype}{void})\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01466}01466\ \ \ \textcolor{keywordtype}{int}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01467}01467\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01468}01468\ \ \ \textcolor{keywordflow}{do}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01469}01469\ \ \ \ \ r\ =\ SEGGER\_RTT\_GetKey();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01470}01470\ \ \ \}\ \textcolor{keywordflow}{while}\ (r\ <\ 0);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01471}01471\ \ \ \textcolor{keywordflow}{return}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01472}01472\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01473}01473\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01474}01474\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01475}01475\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01476}01476\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_HasKey}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01477}01477\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01478}01478\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01479}01479\ \textcolor{comment}{*\ \ \ \ Checks\ if\ at\ least\ one\ character\ for\ reading\ is\ available\ in\ the\ SEGGER\ RTT\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01480}01480\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01481}01481\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01482}01482\ \textcolor{comment}{*\ \ \ \ ==\ 0\ -\/\ \ \ \ \ No\ characters\ are\ available\ to\ read.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01483}01483\ \textcolor{comment}{*\ \ \ \ ==\ 1\ -\/\ \ \ \ \ At\ least\ one\ character\ is\ available.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01484}01484\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01485}01485\ \textcolor{comment}{*\ \ Notes}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01486}01486\ \textcolor{comment}{*\ \ \ \ (1)\ This\ function\ is\ only\ specified\ for\ accesses\ to\ RTT\ buffer\ 0}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01487}01487\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01488}01488\ \textcolor{keywordtype}{int}\ SEGGER\_RTT\_HasKey(\textcolor{keywordtype}{void})\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01489}01489\ \ \ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___d_o_w_n}{SEGGER\_RTT\_BUFFER\_DOWN}}*\ pRing;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01490}01490\ \ \ \textcolor{keywordtype}{unsigned}\ RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01491}01491\ \ \ \textcolor{keywordtype}{int}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01492}01492\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01493}01493\ \ \ INIT();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01494}01494\ \ \ pRing\ =\ (\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___d_o_w_n}{SEGGER\_RTT\_BUFFER\_DOWN}}*)((uintptr\_t)\&\_SEGGER\_RTT.aDown[0]\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01495}01495\ \ \ RdOff\ =\ pRing-\/>RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01496}01496\ \ \ \textcolor{keywordflow}{if}\ (RdOff\ !=\ pRing-\/>WrOff)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01497}01497\ \ \ \ \ r\ =\ 1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01498}01498\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01499}01499\ \ \ \ \ r\ =\ 0;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01500}01500\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01501}01501\ \ \ \textcolor{keywordflow}{return}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01502}01502\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01503}01503\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01504}01504\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01505}01505\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01506}01506\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_HasData}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01507}01507\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01508}01508\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01509}01509\ \textcolor{comment}{*\ \ \ \ Check\ if\ there\ is\ data\ from\ the\ host\ in\ the\ given\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01510}01510\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01511}01511\ \textcolor{comment}{*\ \ Return\ value:}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01512}01512\ \textcolor{comment}{*\ \ ==0:\ \ No\ data}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01513}01513\ \textcolor{comment}{*\ \ !=0:\ \ Data\ in\ buffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01514}01514\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01515}01515\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01516}01516\ \textcolor{keywordtype}{unsigned}\ SEGGER\_RTT\_HasData(\textcolor{keywordtype}{unsigned}\ BufferIndex)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01517}01517\ \ \ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___d_o_w_n}{SEGGER\_RTT\_BUFFER\_DOWN}}*\ pRing;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01518}01518\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ v;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01519}01519\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01520}01520\ \ \ pRing\ =\ (\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___d_o_w_n}{SEGGER\_RTT\_BUFFER\_DOWN}}*)((uintptr\_t)\&\_SEGGER\_RTT.aDown[BufferIndex]\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01521}01521\ \ \ v\ =\ pRing-\/>WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01522}01522\ \ \ \textcolor{keywordflow}{return}\ v\ -\/\ pRing-\/>RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01523}01523\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01524}01524\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01525}01525\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01526}01526\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01527}01527\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_HasDataUp}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01528}01528\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01529}01529\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01530}01530\ \textcolor{comment}{*\ \ \ \ Check\ if\ there\ is\ data\ remaining\ to\ be\ sent\ in\ the\ given\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01531}01531\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01532}01532\ \textcolor{comment}{*\ \ Return\ value:}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01533}01533\ \textcolor{comment}{*\ \ ==0:\ \ No\ data}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01534}01534\ \textcolor{comment}{*\ \ !=0:\ \ Data\ in\ buffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01535}01535\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01536}01536\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01537}01537\ \textcolor{keywordtype}{unsigned}\ SEGGER\_RTT\_HasDataUp(\textcolor{keywordtype}{unsigned}\ BufferIndex)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01538}01538\ \ \ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*\ pRing;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01539}01539\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ v;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01540}01540\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01541}01541\ \ \ pRing\ =\ (\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*)((uintptr\_t)\&\_SEGGER\_RTT.aUp[BufferIndex]\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01542}01542\ \ \ v\ =\ pRing-\/>RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01543}01543\ \ \ \textcolor{keywordflow}{return}\ pRing-\/>WrOff\ -\/\ v;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01544}01544\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01545}01545\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01546}01546\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01547}01547\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01548}01548\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_AllocDownBuffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01549}01549\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01550}01550\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01551}01551\ \textcolor{comment}{*\ \ \ \ Run-\/time\ configuration\ of\ the\ next\ down-\/buffer\ (H-\/>T).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01552}01552\ \textcolor{comment}{*\ \ \ \ The\ next\ buffer,\ which\ is\ not\ used\ yet\ is\ configured.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01553}01553\ \textcolor{comment}{*\ \ \ \ This\ includes:\ Buffer\ address,\ size,\ name,\ flags,\ ...}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01554}01554\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01555}01555\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01556}01556\ \textcolor{comment}{*\ \ \ \ sName\ \ \ \ \ \ \ \ Pointer\ to\ a\ constant\ name\ string.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01557}01557\ \textcolor{comment}{*\ \ \ \ pBuffer\ \ \ \ \ \ Pointer\ to\ a\ buffer\ to\ be\ used.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01558}01558\ \textcolor{comment}{*\ \ \ \ BufferSize\ \ \ Size\ of\ the\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01559}01559\ \textcolor{comment}{*\ \ \ \ Flags\ \ \ \ \ \ \ \ Operating\ modes.\ Define\ behavior\ if\ buffer\ is\ full\ (not\ enough\ space\ for\ entire\ message).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01560}01560\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Flags[31:24]\ are\ used\ for\ validity\ check\ and\ must\ be\ zero.\ Flags[23:2]\ are\ reserved\ for\ future\ use.\ Flags[1:0]\ =\ RTT\ operating\ mode.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01561}01561\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01562}01562\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01563}01563\ \textcolor{comment}{*\ \ \ \ >=\ 0\ -\/\ O.K.\ Buffer\ Index}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01564}01564\ \textcolor{comment}{*\ \ \ \ \ <\ 0\ -\/\ Error}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01565}01565\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01566}01566\ \textcolor{keywordtype}{int}\ SEGGER\_RTT\_AllocDownBuffer(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ sName,\ \textcolor{keywordtype}{void}*\ pBuffer,\ \textcolor{keywordtype}{unsigned}\ BufferSize,\ \textcolor{keywordtype}{unsigned}\ Flags)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01567}01567\ \ \ \textcolor{keywordtype}{int}\ BufferIndex;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01568}01568\ \ \ \textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*\ pRTTCB;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01569}01569\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01570}01570\ \ \ INIT();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01571}01571\ \ \ SEGGER\_RTT\_LOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01572}01572\ \ \ pRTTCB\ =\ (\textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*)((uintptr\_t)\&\_SEGGER\_RTT\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ RTTCB\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01573}01573\ \ \ BufferIndex\ =\ 0;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01574}01574\ \ \ \textcolor{keywordflow}{do}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01575}01575\ \ \ \ \ \textcolor{keywordflow}{if}\ (pRTTCB-\/>aDown[BufferIndex].pBuffer\ ==\ NULL)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01576}01576\ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01577}01577\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01578}01578\ \ \ \ \ BufferIndex++;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01579}01579\ \ \ \}\ \textcolor{keywordflow}{while}\ (BufferIndex\ <\ pRTTCB-\/>MaxNumDownBuffers);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01580}01580\ \ \ \textcolor{keywordflow}{if}\ (BufferIndex\ <\ pRTTCB-\/>MaxNumDownBuffers)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01581}01581\ \ \ \ \ pRTTCB-\/>aDown[BufferIndex].sName\ \ \ \ \ \ \ \ =\ sName;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01582}01582\ \ \ \ \ pRTTCB-\/>aDown[BufferIndex].pBuffer\ \ \ \ \ \ =\ (\textcolor{keywordtype}{char}*)pBuffer;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01583}01583\ \ \ \ \ pRTTCB-\/>aDown[BufferIndex].SizeOfBuffer\ =\ BufferSize;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01584}01584\ \ \ \ \ pRTTCB-\/>aDown[BufferIndex].RdOff\ \ \ \ \ \ \ \ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01585}01585\ \ \ \ \ pRTTCB-\/>aDown[BufferIndex].WrOff\ \ \ \ \ \ \ \ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01586}01586\ \ \ \ \ pRTTCB-\/>aDown[BufferIndex].Flags\ \ \ \ \ \ \ \ =\ Flags;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01587}01587\ \ \ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ data\ write\ to\ be\ complete\ before\ writing\ the\ <WrOff>,\ in\ case\ CPU\ is\ allowed\ to\ change\ the\ order\ of\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01588}01588\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01589}01589\ \ \ \ \ BufferIndex\ =\ -\/1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01590}01590\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01591}01591\ \ \ SEGGER\_RTT\_UNLOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01592}01592\ \ \ \textcolor{keywordflow}{return}\ BufferIndex;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01593}01593\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01594}01594\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01595}01595\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01596}01596\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01597}01597\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_AllocUpBuffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01598}01598\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01599}01599\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01600}01600\ \textcolor{comment}{*\ \ \ \ Run-\/time\ configuration\ of\ the\ next\ up-\/buffer\ (T-\/>H).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01601}01601\ \textcolor{comment}{*\ \ \ \ The\ next\ buffer,\ which\ is\ not\ used\ yet\ is\ configured.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01602}01602\ \textcolor{comment}{*\ \ \ \ This\ includes:\ Buffer\ address,\ size,\ name,\ flags,\ ...}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01603}01603\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01604}01604\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01605}01605\ \textcolor{comment}{*\ \ \ \ sName\ \ \ \ \ \ \ \ Pointer\ to\ a\ constant\ name\ string.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01606}01606\ \textcolor{comment}{*\ \ \ \ pBuffer\ \ \ \ \ \ Pointer\ to\ a\ buffer\ to\ be\ used.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01607}01607\ \textcolor{comment}{*\ \ \ \ BufferSize\ \ \ Size\ of\ the\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01608}01608\ \textcolor{comment}{*\ \ \ \ Flags\ \ \ \ \ \ \ \ Operating\ modes.\ Define\ behavior\ if\ buffer\ is\ full\ (not\ enough\ space\ for\ entire\ message).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01609}01609\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Flags[31:24]\ are\ used\ for\ validity\ check\ and\ must\ be\ zero.\ Flags[23:2]\ are\ reserved\ for\ future\ use.\ Flags[1:0]\ =\ RTT\ operating\ mode.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01610}01610\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01611}01611\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01612}01612\ \textcolor{comment}{*\ \ \ \ >=\ 0\ -\/\ O.K.\ Buffer\ Index}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01613}01613\ \textcolor{comment}{*\ \ \ \ \ <\ 0\ -\/\ Error}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01614}01614\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01615}01615\ \textcolor{keywordtype}{int}\ SEGGER\_RTT\_AllocUpBuffer(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ sName,\ \textcolor{keywordtype}{void}*\ pBuffer,\ \textcolor{keywordtype}{unsigned}\ BufferSize,\ \textcolor{keywordtype}{unsigned}\ Flags)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01616}01616\ \ \ \textcolor{keywordtype}{int}\ BufferIndex;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01617}01617\ \ \ \textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*\ pRTTCB;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01618}01618\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01619}01619\ \ \ INIT();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01620}01620\ \ \ SEGGER\_RTT\_LOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01621}01621\ \ \ pRTTCB\ =\ (\textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*)((uintptr\_t)\&\_SEGGER\_RTT\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ RTTCB\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01622}01622\ \ \ BufferIndex\ =\ 0;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01623}01623\ \ \ \textcolor{keywordflow}{do}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01624}01624\ \ \ \ \ \textcolor{keywordflow}{if}\ (pRTTCB-\/>aUp[BufferIndex].pBuffer\ ==\ NULL)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01625}01625\ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01626}01626\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01627}01627\ \ \ \ \ BufferIndex++;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01628}01628\ \ \ \}\ \textcolor{keywordflow}{while}\ (BufferIndex\ <\ pRTTCB-\/>MaxNumUpBuffers);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01629}01629\ \ \ \textcolor{keywordflow}{if}\ (BufferIndex\ <\ pRTTCB-\/>MaxNumUpBuffers)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01630}01630\ \ \ \ \ pRTTCB-\/>aUp[BufferIndex].sName\ \ \ \ \ \ \ \ =\ sName;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01631}01631\ \ \ \ \ pRTTCB-\/>aUp[BufferIndex].pBuffer\ \ \ \ \ \ =\ (\textcolor{keywordtype}{char}*)pBuffer;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01632}01632\ \ \ \ \ pRTTCB-\/>aUp[BufferIndex].SizeOfBuffer\ =\ BufferSize;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01633}01633\ \ \ \ \ pRTTCB-\/>aUp[BufferIndex].RdOff\ \ \ \ \ \ \ \ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01634}01634\ \ \ \ \ pRTTCB-\/>aUp[BufferIndex].WrOff\ \ \ \ \ \ \ \ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01635}01635\ \ \ \ \ pRTTCB-\/>aUp[BufferIndex].Flags\ \ \ \ \ \ \ \ =\ Flags;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01636}01636\ \ \ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ data\ write\ to\ be\ complete\ before\ writing\ the\ <WrOff>,\ in\ case\ CPU\ is\ allowed\ to\ change\ the\ order\ of\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01637}01637\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01638}01638\ \ \ \ \ BufferIndex\ =\ -\/1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01639}01639\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01640}01640\ \ \ SEGGER\_RTT\_UNLOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01641}01641\ \ \ \textcolor{keywordflow}{return}\ BufferIndex;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01642}01642\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01643}01643\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01644}01644\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01645}01645\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01646}01646\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_ConfigUpBuffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01647}01647\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01648}01648\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01649}01649\ \textcolor{comment}{*\ \ \ \ Run-\/time\ configuration\ of\ a\ specific\ up-\/buffer\ (T-\/>H).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01650}01650\ \textcolor{comment}{*\ \ \ \ Buffer\ to\ be\ configured\ is\ specified\ by\ index.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01651}01651\ \textcolor{comment}{*\ \ \ \ This\ includes:\ Buffer\ address,\ size,\ name,\ flags,\ ...}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01652}01652\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01653}01653\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01654}01654\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ the\ buffer\ to\ configure.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01655}01655\ \textcolor{comment}{*\ \ \ \ sName\ \ \ \ \ \ \ \ Pointer\ to\ a\ constant\ name\ string.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01656}01656\ \textcolor{comment}{*\ \ \ \ pBuffer\ \ \ \ \ \ Pointer\ to\ a\ buffer\ to\ be\ used.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01657}01657\ \textcolor{comment}{*\ \ \ \ BufferSize\ \ \ Size\ of\ the\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01658}01658\ \textcolor{comment}{*\ \ \ \ Flags\ \ \ \ \ \ \ \ Operating\ modes.\ Define\ behavior\ if\ buffer\ is\ full\ (not\ enough\ space\ for\ entire\ message).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01659}01659\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Flags[31:24]\ are\ used\ for\ validity\ check\ and\ must\ be\ zero.\ Flags[23:2]\ are\ reserved\ for\ future\ use.\ Flags[1:0]\ =\ RTT\ operating\ mode.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01660}01660\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01661}01661\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01662}01662\ \textcolor{comment}{*\ \ \ \ >=\ 0\ -\/\ O.K.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01663}01663\ \textcolor{comment}{*\ \ \ \ \ <\ 0\ -\/\ Error}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01664}01664\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01665}01665\ \textcolor{comment}{*\ \ Additional\ information}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01666}01666\ \textcolor{comment}{*\ \ \ \ Buffer\ 0\ is\ configured\ on\ compile-\/time.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01667}01667\ \textcolor{comment}{*\ \ \ \ May\ only\ be\ called\ once\ per\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01668}01668\ \textcolor{comment}{*\ \ \ \ Buffer\ name\ and\ flags\ can\ be\ reconfigured\ using\ the\ appropriate\ functions.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01669}01669\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01670}01670\ \textcolor{keywordtype}{int}\ SEGGER\_RTT\_ConfigUpBuffer(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ sName,\ \textcolor{keywordtype}{void}*\ pBuffer,\ \textcolor{keywordtype}{unsigned}\ BufferSize,\ \textcolor{keywordtype}{unsigned}\ Flags)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01671}01671\ \ \ \textcolor{keywordtype}{int}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01672}01672\ \ \ \textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*\ pRTTCB;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01673}01673\ \ \ \textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*\ pUp;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01674}01674\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01675}01675\ \ \ INIT();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01676}01676\ \ \ pRTTCB\ =\ (\textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*)((uintptr\_t)\&\_SEGGER\_RTT\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ RTTCB\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01677}01677\ \ \ \textcolor{keywordflow}{if}\ (BufferIndex\ <\ SEGGER\_RTT\_MAX\_NUM\_UP\_BUFFERS)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01678}01678\ \ \ \ \ SEGGER\_RTT\_LOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01679}01679\ \ \ \ \ pUp\ =\ \&pRTTCB-\/>aUp[BufferIndex];}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01680}01680\ \ \ \ \ \textcolor{keywordflow}{if}\ (BufferIndex)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01681}01681\ \ \ \ \ \ \ pUp-\/>sName\ \ \ \ \ \ \ \ =\ sName;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01682}01682\ \ \ \ \ \ \ pUp-\/>pBuffer\ \ \ \ \ \ =\ (\textcolor{keywordtype}{char}*)pBuffer;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01683}01683\ \ \ \ \ \ \ pUp-\/>SizeOfBuffer\ =\ BufferSize;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01684}01684\ \ \ \ \ \ \ pUp-\/>RdOff\ \ \ \ \ \ \ \ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01685}01685\ \ \ \ \ \ \ pUp-\/>WrOff\ \ \ \ \ \ \ \ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01686}01686\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01687}01687\ \ \ \ \ pUp-\/>Flags\ \ \ \ \ \ \ \ \ \ =\ Flags;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01688}01688\ \ \ \ \ SEGGER\_RTT\_UNLOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01689}01689\ \ \ \ \ r\ =\ \ 0;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01690}01690\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01691}01691\ \ \ \ \ r\ =\ -\/1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01692}01692\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01693}01693\ \ \ \textcolor{keywordflow}{return}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01694}01694\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01695}01695\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01696}01696\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01697}01697\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01698}01698\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_ConfigDownBuffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01699}01699\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01700}01700\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01701}01701\ \textcolor{comment}{*\ \ \ \ Run-\/time\ configuration\ of\ a\ specific\ down-\/buffer\ (H-\/>T).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01702}01702\ \textcolor{comment}{*\ \ \ \ Buffer\ to\ be\ configured\ is\ specified\ by\ index.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01703}01703\ \textcolor{comment}{*\ \ \ \ This\ includes:\ Buffer\ address,\ size,\ name,\ flags,\ ...}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01704}01704\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01705}01705\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01706}01706\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ the\ buffer\ to\ configure.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01707}01707\ \textcolor{comment}{*\ \ \ \ sName\ \ \ \ \ \ \ \ Pointer\ to\ a\ constant\ name\ string.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01708}01708\ \textcolor{comment}{*\ \ \ \ pBuffer\ \ \ \ \ \ Pointer\ to\ a\ buffer\ to\ be\ used.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01709}01709\ \textcolor{comment}{*\ \ \ \ BufferSize\ \ \ Size\ of\ the\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01710}01710\ \textcolor{comment}{*\ \ \ \ Flags\ \ \ \ \ \ \ \ Operating\ modes.\ Define\ behavior\ if\ buffer\ is\ full\ (not\ enough\ space\ for\ entire\ message).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01711}01711\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Flags[31:24]\ are\ used\ for\ validity\ check\ and\ must\ be\ zero.\ Flags[23:2]\ are\ reserved\ for\ future\ use.\ Flags[1:0]\ =\ RTT\ operating\ mode.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01712}01712\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01713}01713\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01714}01714\ \textcolor{comment}{*\ \ \ \ >=\ 0\ \ O.K.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01715}01715\ \textcolor{comment}{*\ \ \ \ \ <\ 0\ \ Error}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01716}01716\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01717}01717\ \textcolor{comment}{*\ \ Additional\ information}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01718}01718\ \textcolor{comment}{*\ \ \ \ Buffer\ 0\ is\ configured\ on\ compile-\/time.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01719}01719\ \textcolor{comment}{*\ \ \ \ May\ only\ be\ called\ once\ per\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01720}01720\ \textcolor{comment}{*\ \ \ \ Buffer\ name\ and\ flags\ can\ be\ reconfigured\ using\ the\ appropriate\ functions.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01721}01721\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01722}01722\ \textcolor{keywordtype}{int}\ SEGGER\_RTT\_ConfigDownBuffer(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ sName,\ \textcolor{keywordtype}{void}*\ pBuffer,\ \textcolor{keywordtype}{unsigned}\ BufferSize,\ \textcolor{keywordtype}{unsigned}\ Flags)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01723}01723\ \ \ \textcolor{keywordtype}{int}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01724}01724\ \ \ \textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*\ pRTTCB;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01725}01725\ \ \ \textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___d_o_w_n}{SEGGER\_RTT\_BUFFER\_DOWN}}*\ pDown;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01726}01726\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01727}01727\ \ \ INIT();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01728}01728\ \ \ pRTTCB\ =\ (\textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*)((uintptr\_t)\&\_SEGGER\_RTT\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ RTTCB\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01729}01729\ \ \ \textcolor{keywordflow}{if}\ (BufferIndex\ <\ SEGGER\_RTT\_MAX\_NUM\_DOWN\_BUFFERS)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01730}01730\ \ \ \ \ SEGGER\_RTT\_LOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01731}01731\ \ \ \ \ pDown\ =\ \&pRTTCB-\/>aDown[BufferIndex];}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01732}01732\ \ \ \ \ \textcolor{keywordflow}{if}\ (BufferIndex)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01733}01733\ \ \ \ \ \ \ pDown-\/>sName\ \ \ \ \ \ \ \ =\ sName;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01734}01734\ \ \ \ \ \ \ pDown-\/>pBuffer\ \ \ \ \ \ =\ (\textcolor{keywordtype}{char}*)pBuffer;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01735}01735\ \ \ \ \ \ \ pDown-\/>SizeOfBuffer\ =\ BufferSize;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01736}01736\ \ \ \ \ \ \ pDown-\/>RdOff\ \ \ \ \ \ \ \ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01737}01737\ \ \ \ \ \ \ pDown-\/>WrOff\ \ \ \ \ \ \ \ =\ 0u;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01738}01738\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01739}01739\ \ \ \ \ pDown-\/>Flags\ \ \ \ \ \ \ \ \ \ =\ Flags;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01740}01740\ \ \ \ \ RTT\_\_DMB();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Force\ data\ write\ to\ be\ complete\ before\ writing\ the\ <WrOff>,\ in\ case\ CPU\ is\ allowed\ to\ change\ the\ order\ of\ memory\ accesses}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01741}01741\ \ \ \ \ SEGGER\_RTT\_UNLOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01742}01742\ \ \ \ \ r\ =\ \ 0;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01743}01743\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01744}01744\ \ \ \ \ r\ =\ -\/1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01745}01745\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01746}01746\ \ \ \textcolor{keywordflow}{return}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01747}01747\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01748}01748\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01749}01749\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01750}01750\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01751}01751\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_SetNameUpBuffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01752}01752\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01753}01753\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01754}01754\ \textcolor{comment}{*\ \ \ \ Run-\/time\ configuration\ of\ a\ specific\ up-\/buffer\ name\ (T-\/>H).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01755}01755\ \textcolor{comment}{*\ \ \ \ Buffer\ to\ be\ configured\ is\ specified\ by\ index.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01756}01756\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01757}01757\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01758}01758\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ the\ buffer\ to\ renamed.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01759}01759\ \textcolor{comment}{*\ \ \ \ sName\ \ \ \ \ \ \ \ Pointer\ to\ a\ constant\ name\ string.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01760}01760\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01761}01761\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01762}01762\ \textcolor{comment}{*\ \ \ \ >=\ 0\ \ O.K.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01763}01763\ \textcolor{comment}{*\ \ \ \ \ <\ 0\ \ Error}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01764}01764\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01765}01765\ \textcolor{keywordtype}{int}\ SEGGER\_RTT\_SetNameUpBuffer(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ sName)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01766}01766\ \ \ \textcolor{keywordtype}{int}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01767}01767\ \ \ \textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*\ pRTTCB;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01768}01768\ \ \ \textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*\ pUp;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01769}01769\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01770}01770\ \ \ INIT();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01771}01771\ \ \ pRTTCB\ =\ (\textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*)((uintptr\_t)\&\_SEGGER\_RTT\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ RTTCB\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01772}01772\ \ \ \textcolor{keywordflow}{if}\ (BufferIndex\ <\ SEGGER\_RTT\_MAX\_NUM\_UP\_BUFFERS)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01773}01773\ \ \ \ \ SEGGER\_RTT\_LOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01774}01774\ \ \ \ \ pUp\ =\ \&pRTTCB-\/>aUp[BufferIndex];}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01775}01775\ \ \ \ \ pUp-\/>sName\ =\ sName;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01776}01776\ \ \ \ \ SEGGER\_RTT\_UNLOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01777}01777\ \ \ \ \ r\ =\ \ 0;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01778}01778\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01779}01779\ \ \ \ \ r\ =\ -\/1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01780}01780\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01781}01781\ \ \ \textcolor{keywordflow}{return}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01782}01782\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01783}01783\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01784}01784\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01785}01785\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01786}01786\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_SetNameDownBuffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01787}01787\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01788}01788\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01789}01789\ \textcolor{comment}{*\ \ \ \ Run-\/time\ configuration\ of\ a\ specific\ Down-\/buffer\ name\ (T-\/>H).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01790}01790\ \textcolor{comment}{*\ \ \ \ Buffer\ to\ be\ configured\ is\ specified\ by\ index.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01791}01791\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01792}01792\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01793}01793\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ the\ buffer\ to\ renamed.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01794}01794\ \textcolor{comment}{*\ \ \ \ sName\ \ \ \ \ \ \ \ Pointer\ to\ a\ constant\ name\ string.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01795}01795\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01796}01796\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01797}01797\ \textcolor{comment}{*\ \ \ \ >=\ 0\ \ O.K.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01798}01798\ \textcolor{comment}{*\ \ \ \ \ <\ 0\ \ Error}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01799}01799\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01800}01800\ \textcolor{keywordtype}{int}\ SEGGER\_RTT\_SetNameDownBuffer(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ sName)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01801}01801\ \ \ \textcolor{keywordtype}{int}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01802}01802\ \ \ \textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*\ pRTTCB;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01803}01803\ \ \ \textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___d_o_w_n}{SEGGER\_RTT\_BUFFER\_DOWN}}*\ pDown;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01804}01804\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01805}01805\ \ \ INIT();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01806}01806\ \ \ pRTTCB\ =\ (\textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*)((uintptr\_t)\&\_SEGGER\_RTT\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ RTTCB\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01807}01807\ \ \ \textcolor{keywordflow}{if}\ (BufferIndex\ <\ SEGGER\_RTT\_MAX\_NUM\_DOWN\_BUFFERS)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01808}01808\ \ \ \ \ SEGGER\_RTT\_LOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01809}01809\ \ \ \ \ pDown\ =\ \&pRTTCB-\/>aDown[BufferIndex];}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01810}01810\ \ \ \ \ pDown-\/>sName\ =\ sName;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01811}01811\ \ \ \ \ SEGGER\_RTT\_UNLOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01812}01812\ \ \ \ \ r\ =\ \ 0;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01813}01813\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01814}01814\ \ \ \ \ r\ =\ -\/1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01815}01815\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01816}01816\ \ \ \textcolor{keywordflow}{return}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01817}01817\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01818}01818\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01819}01819\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01820}01820\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01821}01821\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_SetFlagsUpBuffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01822}01822\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01823}01823\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01824}01824\ \textcolor{comment}{*\ \ \ \ Run-\/time\ configuration\ of\ specific\ up-\/buffer\ flags\ (T-\/>H).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01825}01825\ \textcolor{comment}{*\ \ \ \ Buffer\ to\ be\ configured\ is\ specified\ by\ index.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01826}01826\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01827}01827\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01828}01828\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ the\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01829}01829\ \textcolor{comment}{*\ \ \ \ Flags\ \ \ \ \ \ \ \ Flags\ to\ set\ for\ the\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01830}01830\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Flags[31:24]\ are\ used\ for\ validity\ check\ and\ must\ be\ zero.\ Flags[23:2]\ are\ reserved\ for\ future\ use.\ Flags[1:0]\ =\ RTT\ operating\ mode.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01831}01831\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01832}01832\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01833}01833\ \textcolor{comment}{*\ \ \ \ >=\ 0\ \ O.K.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01834}01834\ \textcolor{comment}{*\ \ \ \ \ <\ 0\ \ Error}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01835}01835\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01836}01836\ \textcolor{keywordtype}{int}\ SEGGER\_RTT\_SetFlagsUpBuffer(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keywordtype}{unsigned}\ Flags)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01837}01837\ \ \ \textcolor{keywordtype}{int}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01838}01838\ \ \ \textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*\ pRTTCB;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01839}01839\ \ \ \textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*\ pUp;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01840}01840\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01841}01841\ \ \ INIT();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01842}01842\ \ \ pRTTCB\ =\ (\textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*)((uintptr\_t)\&\_SEGGER\_RTT\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ RTTCB\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01843}01843\ \ \ \textcolor{keywordflow}{if}\ (BufferIndex\ <\ SEGGER\_RTT\_MAX\_NUM\_UP\_BUFFERS)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01844}01844\ \ \ \ \ SEGGER\_RTT\_LOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01845}01845\ \ \ \ \ pUp\ =\ \&pRTTCB-\/>aUp[BufferIndex];}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01846}01846\ \ \ \ \ pUp-\/>Flags\ =\ Flags;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01847}01847\ \ \ \ \ SEGGER\_RTT\_UNLOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01848}01848\ \ \ \ \ r\ =\ \ 0;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01849}01849\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01850}01850\ \ \ \ \ r\ =\ -\/1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01851}01851\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01852}01852\ \ \ \textcolor{keywordflow}{return}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01853}01853\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01854}01854\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01855}01855\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01856}01856\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01857}01857\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_SetFlagsDownBuffer}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01858}01858\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01859}01859\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01860}01860\ \textcolor{comment}{*\ \ \ \ Run-\/time\ configuration\ of\ specific\ Down-\/buffer\ flags\ (T-\/>H).}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01861}01861\ \textcolor{comment}{*\ \ \ \ Buffer\ to\ be\ configured\ is\ specified\ by\ index.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01862}01862\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01863}01863\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01864}01864\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ the\ buffer\ to\ renamed.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01865}01865\ \textcolor{comment}{*\ \ \ \ Flags\ \ \ \ \ \ \ \ Flags\ to\ set\ for\ the\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01866}01866\ \textcolor{comment}{*\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Flags[31:24]\ are\ used\ for\ validity\ check\ and\ must\ be\ zero.\ Flags[23:2]\ are\ reserved\ for\ future\ use.\ Flags[1:0]\ =\ RTT\ operating\ mode.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01867}01867\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01868}01868\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01869}01869\ \textcolor{comment}{*\ \ \ \ >=\ 0\ \ O.K.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01870}01870\ \textcolor{comment}{*\ \ \ \ \ <\ 0\ \ Error}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01871}01871\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01872}01872\ \textcolor{keywordtype}{int}\ SEGGER\_RTT\_SetFlagsDownBuffer(\textcolor{keywordtype}{unsigned}\ BufferIndex,\ \textcolor{keywordtype}{unsigned}\ Flags)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01873}01873\ \ \ \textcolor{keywordtype}{int}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01874}01874\ \ \ \textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*\ pRTTCB;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01875}01875\ \ \ \textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___d_o_w_n}{SEGGER\_RTT\_BUFFER\_DOWN}}*\ pDown;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01876}01876\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01877}01877\ \ \ INIT();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01878}01878\ \ \ pRTTCB\ =\ (\textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*)((uintptr\_t)\&\_SEGGER\_RTT\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ RTTCB\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01879}01879\ \ \ \textcolor{keywordflow}{if}\ (BufferIndex\ <\ SEGGER\_RTT\_MAX\_NUM\_DOWN\_BUFFERS)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01880}01880\ \ \ \ \ SEGGER\_RTT\_LOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01881}01881\ \ \ \ \ pDown\ =\ \&pRTTCB-\/>aDown[BufferIndex];}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01882}01882\ \ \ \ \ pDown-\/>Flags\ =\ Flags;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01883}01883\ \ \ \ \ SEGGER\_RTT\_UNLOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01884}01884\ \ \ \ \ r\ =\ \ 0;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01885}01885\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01886}01886\ \ \ \ \ r\ =\ -\/1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01887}01887\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01888}01888\ \ \ \textcolor{keywordflow}{return}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01889}01889\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01890}01890\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01891}01891\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01892}01892\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01893}01893\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_Init}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01894}01894\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01895}01895\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01896}01896\ \textcolor{comment}{*\ \ \ \ Initializes\ the\ RTT\ Control\ Block.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01897}01897\ \textcolor{comment}{*\ \ \ \ Should\ be\ used\ in\ RAM\ targets,\ at\ start\ of\ the\ application.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01898}01898\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01899}01899\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01900}01900\ \textcolor{keywordtype}{void}\ SEGGER\_RTT\_Init\ (\textcolor{keywordtype}{void})\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01901}01901\ \ \ \_DoInit();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01902}01902\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01903}01903\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01904}01904\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01905}01905\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01906}01906\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_SetTerminal}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01907}01907\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01908}01908\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01909}01909\ \textcolor{comment}{*\ \ \ \ Sets\ the\ terminal\ to\ be\ used\ for\ output\ on\ channel\ 0.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01910}01910\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01911}01911\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01912}01912\ \textcolor{comment}{*\ \ \ \ TerminalId\ \ Index\ of\ the\ terminal.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01913}01913\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01914}01914\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01915}01915\ \textcolor{comment}{*\ \ \ \ >=\ 0\ \ O.K.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01916}01916\ \textcolor{comment}{*\ \ \ \ \ <\ 0\ \ Error\ (e.g.\ if\ RTT\ is\ configured\ for\ non-\/blocking\ mode\ and\ there\ was\ no\ space\ in\ the\ buffer\ to\ set\ the\ new\ terminal\ Id)}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01917}01917\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01918}01918\ \textcolor{comment}{*\ \ Notes}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01919}01919\ \textcolor{comment}{*\ \ \ \ (1)\ Buffer\ 0\ is\ always\ reserved\ for\ terminal\ I/O,\ so\ we\ can\ use\ index\ 0\ here,\ fixed}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01920}01920\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01921}01921\ \textcolor{keywordtype}{int}\ SEGGER\_RTT\_SetTerminal\ (\textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{char}\ TerminalId)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01922}01922\ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{char}\ \ \ \ \ \ \ \ \ ac[2];}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01923}01923\ \ \ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*\ pRing;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01924}01924\ \ \ \textcolor{keywordtype}{unsigned}\ Avail;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01925}01925\ \ \ \textcolor{keywordtype}{int}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01926}01926\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01927}01927\ \ \ INIT();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01928}01928\ \ \ r\ =\ 0;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01929}01929\ \ \ ac[0]\ =\ 0xFFu;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01930}01930\ \ \ \textcolor{keywordflow}{if}\ (TerminalId\ <\ \textcolor{keyword}{sizeof}(\_aTerminalId))\ \{\ \textcolor{comment}{//\ We\ only\ support\ a\ certain\ number\ of\ channels}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01931}01931\ \ \ \ \ ac[1]\ =\ \_aTerminalId[TerminalId];}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01932}01932\ \ \ \ \ pRing\ =\ (\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*)((uintptr\_t)\&\_SEGGER\_RTT.aUp[0]\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01933}01933\ \ \ \ \ SEGGER\_RTT\_LOCK();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Lock\ to\ make\ sure\ that\ no\ other\ task\ is\ writing\ into\ buffer,\ while\ we\ are\ and\ number\ of\ free\ bytes\ in\ buffer\ does\ not\ change\ downwards\ after\ checking\ and\ before\ writing}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01934}01934\ \ \ \ \ \textcolor{keywordflow}{if}\ ((pRing-\/>Flags\ \&\ SEGGER\_RTT\_MODE\_MASK)\ ==\ SEGGER\_RTT\_MODE\_BLOCK\_IF\_FIFO\_FULL)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01935}01935\ \ \ \ \ \ \ \_ActiveTerminal\ =\ TerminalId;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01936}01936\ \ \ \ \ \ \ \_WriteBlocking(pRing,\ (\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*)ac,\ 2u);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01937}01937\ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Skipping\ mode\ or\ trim\ mode?\ =>\ We\ cannot\ trim\ this\ command\ so\ handling\ is\ the\ same\ for\ both\ modes}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01938}01938\ \ \ \ \ \ \ Avail\ =\ \_GetAvailWriteSpace(pRing);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01939}01939\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (Avail\ >=\ 2)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01940}01940\ \ \ \ \ \ \ \ \ \_ActiveTerminal\ =\ TerminalId;\ \ \ \ \textcolor{comment}{//\ Only\ change\ active\ terminal\ in\ case\ of\ success}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01941}01941\ \ \ \ \ \ \ \ \ \_WriteNoCheck(pRing,\ (\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*)ac,\ 2u);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01942}01942\ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01943}01943\ \ \ \ \ \ \ \ \ r\ =\ -\/1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01944}01944\ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01945}01945\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01946}01946\ \ \ \ \ SEGGER\_RTT\_UNLOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01947}01947\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01948}01948\ \ \ \ \ r\ =\ -\/1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01949}01949\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01950}01950\ \ \ \textcolor{keywordflow}{return}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01951}01951\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01952}01952\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01953}01953\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01954}01954\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01955}01955\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_TerminalOut}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01956}01956\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01957}01957\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01958}01958\ \textcolor{comment}{*\ \ \ \ Writes\ a\ string\ to\ the\ given\ terminal}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01959}01959\ \textcolor{comment}{*\ \ \ \ \ without\ changing\ the\ terminal\ for\ channel\ 0.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01960}01960\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01961}01961\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01962}01962\ \textcolor{comment}{*\ \ \ \ TerminalId\ \ \ Index\ of\ the\ terminal.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01963}01963\ \textcolor{comment}{*\ \ \ \ s\ \ \ \ \ \ \ \ \ \ \ \ String\ to\ be\ printed\ on\ the\ terminal.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01964}01964\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01965}01965\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01966}01966\ \textcolor{comment}{*\ \ \ \ >=\ 0\ -\/\ Number\ of\ bytes\ written.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01967}01967\ \textcolor{comment}{*\ \ \ \ \ <\ 0\ -\/\ Error.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01968}01968\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01969}01969\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01970}01970\ \textcolor{keywordtype}{int}\ SEGGER\_RTT\_TerminalOut\ (\textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{char}\ TerminalId,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ s)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01971}01971\ \ \ \textcolor{keywordtype}{int}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Status;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01972}01972\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ FragLen;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01973}01973\ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ Avail;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01974}01974\ \ \ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*\ pRing;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01975}01975\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01976}01976\ \ \ INIT();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01977}01977\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01978}01978\ \ \ \textcolor{comment}{//\ Validate\ terminal\ ID.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01979}01979\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01980}01980\ \ \ \textcolor{keywordflow}{if}\ (TerminalId\ <\ (\textcolor{keywordtype}{char})\textcolor{keyword}{sizeof}(\_aTerminalId))\ \{\ \textcolor{comment}{//\ We\ only\ support\ a\ certain\ number\ of\ channels}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01981}01981\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01982}01982\ \ \ \ \ \textcolor{comment}{//\ Get\ "{}to-\/host"{}\ ring\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01983}01983\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01984}01984\ \ \ \ \ pRing\ =\ (\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*)((uintptr\_t)\&\_SEGGER\_RTT.aUp[0]\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01985}01985\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01986}01986\ \ \ \ \ \textcolor{comment}{//\ Need\ to\ be\ able\ to\ change\ terminal,\ write\ data,\ change\ back.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01987}01987\ \ \ \ \ \textcolor{comment}{//\ Compute\ the\ fixed\ and\ variable\ sizes.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01988}01988\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01989}01989\ \ \ \ \ FragLen\ =\ STRLEN(s);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01990}01990\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01991}01991\ \ \ \ \ \textcolor{comment}{//\ How\ we\ output\ depends\ upon\ the\ mode...}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01992}01992\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01993}01993\ \ \ \ \ SEGGER\_RTT\_LOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01994}01994\ \ \ \ \ Avail\ =\ \_GetAvailWriteSpace(pRing);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01995}01995\ \ \ \ \ \textcolor{keywordflow}{switch}\ (pRing-\/>Flags\ \&\ SEGGER\_RTT\_MODE\_MASK)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01996}01996\ \ \ \ \ \textcolor{keywordflow}{case}\ SEGGER\_RTT\_MODE\_NO\_BLOCK\_SKIP:}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01997}01997\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01998}01998\ \ \ \ \ \ \ \textcolor{comment}{//\ If\ we\ are\ in\ skip\ mode\ and\ there\ is\ no\ space\ for\ the\ whole}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l01999}01999\ \ \ \ \ \ \ \textcolor{comment}{//\ of\ this\ output,\ don't\ bother\ switching\ terminals\ at\ all.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02000}02000\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02001}02001\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (Avail\ <\ (FragLen\ +\ 4u))\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02002}02002\ \ \ \ \ \ \ \ \ Status\ =\ 0;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02003}02003\ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02004}02004\ \ \ \ \ \ \ \ \ \_PostTerminalSwitch(pRing,\ TerminalId);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02005}02005\ \ \ \ \ \ \ \ \ Status\ =\ (int)\_WriteBlocking(pRing,\ s,\ FragLen);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02006}02006\ \ \ \ \ \ \ \ \ \_PostTerminalSwitch(pRing,\ \_ActiveTerminal);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02007}02007\ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02008}02008\ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02009}02009\ \ \ \ \ \textcolor{keywordflow}{case}\ SEGGER\_RTT\_MODE\_NO\_BLOCK\_TRIM:}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02010}02010\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02011}02011\ \ \ \ \ \ \ \textcolor{comment}{//\ If\ we\ are\ in\ trim\ mode\ and\ there\ is\ not\ enough\ space\ for\ everything,}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02012}02012\ \ \ \ \ \ \ \textcolor{comment}{//\ trim\ the\ output\ but\ always\ include\ the\ terminal\ switch.\ \ If\ no\ room}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02013}02013\ \ \ \ \ \ \ \textcolor{comment}{//\ for\ terminal\ switch,\ skip\ that\ totally.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02014}02014\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02015}02015\ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (Avail\ <\ 4u)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02016}02016\ \ \ \ \ \ \ \ \ Status\ =\ -\/1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02017}02017\ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02018}02018\ \ \ \ \ \ \ \ \ \_PostTerminalSwitch(pRing,\ TerminalId);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02019}02019\ \ \ \ \ \ \ \ \ Status\ =\ (int)\_WriteBlocking(pRing,\ s,\ (FragLen\ <\ (Avail\ -\/\ 4u))\ ?\ FragLen\ :\ (Avail\ -\/\ 4u));}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02020}02020\ \ \ \ \ \ \ \ \ \_PostTerminalSwitch(pRing,\ \_ActiveTerminal);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02021}02021\ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02022}02022\ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02023}02023\ \ \ \ \ \textcolor{keywordflow}{case}\ SEGGER\_RTT\_MODE\_BLOCK\_IF\_FIFO\_FULL:}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02024}02024\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02025}02025\ \ \ \ \ \ \ \textcolor{comment}{//\ If\ we\ are\ in\ blocking\ mode,\ output\ everything.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02026}02026\ \ \ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02027}02027\ \ \ \ \ \ \ \_PostTerminalSwitch(pRing,\ TerminalId);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02028}02028\ \ \ \ \ \ \ Status\ =\ (int)\_WriteBlocking(pRing,\ s,\ FragLen);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02029}02029\ \ \ \ \ \ \ \_PostTerminalSwitch(pRing,\ \_ActiveTerminal);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02030}02030\ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02031}02031\ \ \ \ \ \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02032}02032\ \ \ \ \ \ \ Status\ =\ -\/1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02033}02033\ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02034}02034\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02035}02035\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02036}02036\ \ \ \ \ \textcolor{comment}{//\ Finish\ up.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02037}02037\ \ \ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02038}02038\ \ \ \ \ SEGGER\_RTT\_UNLOCK();}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02039}02039\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02040}02040\ \ \ \ \ Status\ =\ -\/1;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02041}02041\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02042}02042\ \ \ \textcolor{keywordflow}{return}\ Status;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02043}02043\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02044}02044\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02045}02045\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02046}02046\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02047}02047\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_GetAvailWriteSpace}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02048}02048\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02049}02049\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02050}02050\ \textcolor{comment}{*\ \ \ \ Returns\ the\ number\ of\ bytes\ available\ in\ the\ ring\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02051}02051\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02052}02052\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02053}02053\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ the\ up\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02054}02054\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02055}02055\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02056}02056\ \textcolor{comment}{*\ \ \ \ Number\ of\ bytes\ that\ are\ free\ in\ the\ selected\ up\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02057}02057\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02058}02058\ \textcolor{keywordtype}{unsigned}\ SEGGER\_RTT\_GetAvailWriteSpace\ (\textcolor{keywordtype}{unsigned}\ BufferIndex)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02059}02059\ \ \ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*\ pRing;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02060}02060\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02061}02061\ \ \ pRing\ =\ (\mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___b_u_f_f_e_r___u_p}{SEGGER\_RTT\_BUFFER\_UP}}*)((uintptr\_t)\&\_SEGGER\_RTT.aUp[BufferIndex]\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02062}02062\ \ \ \textcolor{keywordflow}{return}\ \_GetAvailWriteSpace(pRing);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02063}02063\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02064}02064\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02065}02065\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02066}02066\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02067}02067\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02068}02068\ \textcolor{comment}{*\ \ \ \ \ \ \ SEGGER\_RTT\_GetBytesInBuffer()}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02069}02069\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02070}02070\ \textcolor{comment}{*\ \ Function\ description}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02071}02071\ \textcolor{comment}{*\ \ \ \ Returns\ the\ number\ of\ bytes\ currently\ used\ in\ the\ up\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02072}02072\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02073}02073\ \textcolor{comment}{*\ \ Parameters}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02074}02074\ \textcolor{comment}{*\ \ \ \ BufferIndex\ \ Index\ of\ the\ up\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02075}02075\ \textcolor{comment}{*}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02076}02076\ \textcolor{comment}{*\ \ Return\ value}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02077}02077\ \textcolor{comment}{*\ \ \ \ Number\ of\ bytes\ that\ are\ used\ in\ the\ buffer.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02078}02078\ \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02079}02079\ \textcolor{keywordtype}{unsigned}\ SEGGER\_RTT\_GetBytesInBuffer(\textcolor{keywordtype}{unsigned}\ BufferIndex)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02080}02080\ \ \ \textcolor{keywordtype}{unsigned}\ RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02081}02081\ \ \ \textcolor{keywordtype}{unsigned}\ WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02082}02082\ \ \ \textcolor{keywordtype}{unsigned}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02083}02083\ \ \ \textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*\ pRTTCB;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02084}02084\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02085}02085\ \ \ \textcolor{comment}{//\ Avoid\ warnings\ regarding\ volatile\ access\ order.\ \ It's\ not\ a\ problem}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02086}02086\ \ \ \textcolor{comment}{//\ in\ this\ case,\ but\ dampen\ compiler\ enthusiasm.}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02087}02087\ \ \ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02088}02088\ \ \ pRTTCB\ =\ (\textcolor{keyword}{volatile}\ \mbox{\hyperlink{struct_s_e_g_g_e_r___r_t_t___c_b}{SEGGER\_RTT\_CB}}*)((uintptr\_t)\&\_SEGGER\_RTT\ +\ SEGGER\_RTT\_UNCACHED\_OFF);\ \ \textcolor{comment}{//\ Access\ RTTCB\ uncached\ to\ make\ sure\ we\ see\ changes\ made\ by\ the\ J-\/Link\ side\ and\ all\ of\ our\ changes\ go\ into\ HW\ directly}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02089}02089\ \ \ RdOff\ =\ pRTTCB-\/>aUp[BufferIndex].RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02090}02090\ \ \ WrOff\ =\ pRTTCB-\/>aUp[BufferIndex].WrOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02091}02091\ \ \ \textcolor{keywordflow}{if}\ (RdOff\ <=\ WrOff)\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02092}02092\ \ \ \ \ r\ =\ WrOff\ -\/\ RdOff;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02093}02093\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02094}02094\ \ \ \ \ r\ =\ pRTTCB-\/>aUp[BufferIndex].SizeOfBuffer\ -\/\ (WrOff\ -\/\ RdOff);}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02095}02095\ \ \ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02096}02096\ \ \ \textcolor{keywordflow}{return}\ r;}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02097}02097\ \}}
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02098}02098\ }
\DoxyCodeLine{\Hypertarget{_s_e_g_g_e_r___r_t_t_8c_source_l02099}02099\ \textcolor{comment}{/***************************\ End\ of\ file\ ****************************/}}

\end{DoxyCode}
