\section{util/firmdl/firmdl.c File Reference}
\label{firmdl_8c}\index{util/firmdl/firmdl.c@{util/firmdl/firmdl.c}}
{\tt \#include $<$sys/types.h$>$}\par
{\tt \#include $<$sys/stat.h$>$}\par
{\tt \#include $<$fcntl.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$unistd.h$>$}\par
{\tt \#include $<$termios.h$>$}\par
{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include $<$sys/time.h$>$}\par
{\tt \#include $<$ctype.h$>$}\par
{\tt \#include $<$assert.h$>$}\par
{\tt \#include \char`\"{}rcx\_\-comm.h\char`\"{}}\par
{\tt \#include \char`\"{}srec.h\char`\"{}}\par
{\tt \#include \char`\"{}fastdl.h\char`\"{}}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define {\bf DEFAULTTTY}\ \char`\"{}/dev/ttyd2\char`\"{}
\item 
\#define {\bf BUFFERSIZE}\ 4096
\item 
\#define {\bf RETRIES}\ 10
\item 
\#define {\bf WAKEUP\_\-TIMEOUT}\ 4000
\item 
\#define {\bf UPLOAD\_\-TIMEOUT}\ 50
\item 
\#define {\bf IMAGE\_\-START}\ 0x8000
\item 
\#define {\bf IMAGE\_\-MAXLEN}\ 0x7000
\item 
\#define {\bf TRANSFER\_\-SIZE}\ 200
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int {\bf srec\_\-load} (char $\ast$name, unsigned char $\ast$image, int maxlen, unsigned short $\ast$start)
\item 
void {\bf image\_\-dl} (FILEDESCR fd, unsigned char $\ast$image, int len, unsigned short start, int use\_\-comp, char $\ast$filename)
\item 
int {\bf main} (int argc, char $\ast$$\ast$argv)
\begin{CompactList}\small\item\em the user {\bf main()}{\rm (p.\,\pageref{fontdesign_8c_a1})} \item\end{CompactList}\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
char $\ast$ {\bf progname}
\item 
int {\bf tty\_\-usb} = 0
\item 
int {\bf \_\-\_\-comm\_\-debug}
\end{CompactItemize}


\subsection{Define Documentation}
\index{firmdl.c@{firmdl.c}!BUFFERSIZE@{BUFFERSIZE}}
\index{BUFFERSIZE@{BUFFERSIZE}!firmdl.c@{firmdl.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define BUFFERSIZE\ 4096}\label{firmdl_8c_a1}




Definition at line 110 of file firmdl.c.

Referenced by rcx\_\-recv(), rcx\_\-wakeup\_\-tower(), and rx\_\-flush().\index{firmdl.c@{firmdl.c}!DEFAULTTTY@{DEFAULTTTY}}
\index{DEFAULTTTY@{DEFAULTTTY}!firmdl.c@{firmdl.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define DEFAULTTTY\ \char`\"{}/dev/ttyd2\char`\"{}}\label{firmdl_8c_a0}




Definition at line 97 of file firmdl.c.\index{firmdl.c@{firmdl.c}!IMAGE_MAXLEN@{IMAGE\_\-MAXLEN}}
\index{IMAGE_MAXLEN@{IMAGE\_\-MAXLEN}!firmdl.c@{firmdl.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define IMAGE\_\-MAXLEN\ 0x7000}\label{firmdl_8c_a6}




Definition at line 117 of file firmdl.c.

Referenced by main(), and srec\_\-load().\index{firmdl.c@{firmdl.c}!IMAGE_START@{IMAGE\_\-START}}
\index{IMAGE_START@{IMAGE\_\-START}!firmdl.c@{firmdl.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define IMAGE\_\-START\ 0x8000}\label{firmdl_8c_a5}




Definition at line 116 of file firmdl.c.

Referenced by srec\_\-load().\index{firmdl.c@{firmdl.c}!RETRIES@{RETRIES}}
\index{RETRIES@{RETRIES}!firmdl.c@{firmdl.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define RETRIES\ 10}\label{firmdl_8c_a2}




Definition at line 111 of file firmdl.c.

Referenced by image\_\-dl().\index{firmdl.c@{firmdl.c}!TRANSFER_SIZE@{TRANSFER\_\-SIZE}}
\index{TRANSFER_SIZE@{TRANSFER\_\-SIZE}!firmdl.c@{firmdl.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define TRANSFER\_\-SIZE\ 200}\label{firmdl_8c_a7}




Definition at line 118 of file firmdl.c.\index{firmdl.c@{firmdl.c}!UPLOAD_TIMEOUT@{UPLOAD\_\-TIMEOUT}}
\index{UPLOAD_TIMEOUT@{UPLOAD\_\-TIMEOUT}!firmdl.c@{firmdl.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define UPLOAD\_\-TIMEOUT\ 50}\label{firmdl_8c_a4}




Definition at line 114 of file firmdl.c.

Referenced by image\_\-dl().\index{firmdl.c@{firmdl.c}!WAKEUP_TIMEOUT@{WAKEUP\_\-TIMEOUT}}
\index{WAKEUP_TIMEOUT@{WAKEUP\_\-TIMEOUT}!firmdl.c@{firmdl.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define WAKEUP\_\-TIMEOUT\ 4000}\label{firmdl_8c_a3}




Definition at line 112 of file firmdl.c.

Referenced by main().

\subsection{Function Documentation}
\index{firmdl.c@{firmdl.c}!image_dl@{image\_\-dl}}
\index{image_dl@{image\_\-dl}!firmdl.c@{firmdl.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void image\_\-dl (FILEDESCR {\em fd}, unsigned char $\ast$ {\em image}, int {\em len}, unsigned short {\em start}, int {\em use\_\-comp}, char $\ast$ {\em filename})}\label{firmdl_8c_a12}




Definition at line 221 of file firmdl.c.

References exit(), memcpy(), progname, rcx\_\-sendrecv(), RETRIES, and UPLOAD\_\-TIMEOUT.

Referenced by main().\index{firmdl.c@{firmdl.c}!main@{main}}
\index{main@{main}!firmdl.c@{firmdl.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int main (int {\em argc}, char $\ast$$\ast$ {\em argv})}\label{firmdl_8c_a13}


the user {\bf main()}{\rm (p.\,\pageref{fontdesign_8c_a1})} 



Definition at line 308 of file firmdl.c.

References \_\-\_\-comm\_\-debug, exit(), FILEDESCR, image\_\-dl(), IMAGE\_\-MAXLEN, progname, rcx\_\-close(), rcx\_\-init(), rcx\_\-is\_\-alive(), rcx\_\-strerror(), rcx\_\-wakeup\_\-tower(), srec\_\-load(), strcmp(), tty\_\-usb, and WAKEUP\_\-TIMEOUT.\index{firmdl.c@{firmdl.c}!srec_load@{srec\_\-load}}
\index{srec_load@{srec\_\-load}!firmdl.c@{firmdl.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int srec\_\-load (char $\ast$ {\em name}, unsigned char $\ast$ {\em image}, int {\em maxlen}, unsigned short $\ast$ {\em start})}\label{firmdl_8c_a11}




Definition at line 132 of file firmdl.c.

References srec\_\-t::addr, srec\_\-t::count, srec\_\-t::data, exit(), IMAGE\_\-MAXLEN, IMAGE\_\-START, memcpy(), memset(), progname, srec\_\-decode(), srec\_\-strerror(), and srec\_\-t::type.

\subsection{Variable Documentation}
\index{firmdl.c@{firmdl.c}!__comm_debug@{\_\-\_\-comm\_\-debug}}
\index{__comm_debug@{\_\-\_\-comm\_\-debug}!firmdl.c@{firmdl.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf \_\-\_\-comm\_\-debug}}\label{firmdl_8c_a10}




Definition at line 65 of file rcx\_\-comm.c.

Referenced by main().\index{firmdl.c@{firmdl.c}!progname@{progname}}
\index{progname@{progname}!firmdl.c@{firmdl.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ {\bf progname}}\label{firmdl_8c_a8}




Definition at line 102 of file firmdl.c.

Referenced by image\_\-dl(), main(), and srec\_\-load().\index{firmdl.c@{firmdl.c}!tty_usb@{tty\_\-usb}}
\index{tty_usb@{tty\_\-usb}!firmdl.c@{firmdl.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf tty\_\-usb} = 0}\label{firmdl_8c_a9}




Definition at line 103 of file firmdl.c.