Este commit está contenido en:
tth 2018-12-20 17:53:18 +01:00
padre bb10042aae
commit 0c6f849310
Se han modificado 4 ficheros con 28 adiciones y 6 borrados

3
.gitignore vendido
Ver fichero

@ -9,4 +9,7 @@ doc/*.log
doc/*.aux
doc/*.pdf
doc/*.idx
doc/*.ilg
doc/*.ind

Ver fichero

@ -1,5 +1,5 @@
\documentclass[a4paper,12pt]{article}
\documentclass[a4paper,11pt]{article}
% \listfiles % pour le debug
@ -8,6 +8,7 @@
\usepackage[T1]{fontenc}
% XXX \usepackage{lipsum}
\usepackage{makeidx}
\usepackage{listings}
% \usepackage{color}
% \usepackage{url}
\usepackage{xspace}
@ -93,7 +94,7 @@ ne demande qu'à grandir.
\subsection{Exemples}
Promis, on va en mettre !
Promis, on va en mettre ! Dès que ça marche\dots
\subsection{Analyses}
@ -120,7 +121,19 @@ La première, que nous allons juste entrevoir, passera par le port
USB de la carte Arduino. La seconde passera par un port série
auxiliaire\footnote{Il y en a 4 sur le 2560} de celle-ci.
\begin{lstlisting}
tcgetattr(uart0, &options);
options.c_cflag = baudbits | CS8 | CLOCAL | CREAD;
options.c_iflag = IGNPAR;
options.c_oflag = 0;
options.c_lflag = 0;
tcflush(uart0, TCIFLUSH);
tcsetattr(uart0, TCSANOW, &options);
\end{lstlisting}
Et en fait, le \texttt{read} sur le \textsl{fd} du serial device
n'est pas bloquant, \texttt{perror} annonce \emph{success}, mais
rien ne marche. L'année 2019 va commencer sur du vaudou programming.
% -------------------------------------------------------------------

8
doc/mkdoc.sh Archivo ejecutable
Ver fichero

@ -0,0 +1,8 @@
#!/bin/bash
pdflatex dd2-monitoring.tex
makeindex dd2-monitoring
pdflatex dd2-monitoring.tex

Ver fichero

@ -68,8 +68,6 @@ if (uart0 < 0)
perror("unable to open uart ");
return -1;
}
return uart0; /* WTF ??? */
// CONFIGURE THE UART
// The flags defined in /usr/include/termios.h -
@ -92,10 +90,10 @@ baudbits = baudrate2const(baudrate);
fprintf(stderr, "%d -> 0x%04x\n", baudrate, baudbits);
#endif
memset(&options, 0, sizeof(options));
memset(&options, 0, sizeof(options));
tcgetattr(uart0, &options);
options.c_cflag = baudbits | CS8 | CLOCAL | CREAD; //<Set baud rate
options.c_cflag = baudbits | CS8 | CLOCAL | CREAD;
options.c_iflag = IGNPAR;
options.c_oflag = 0;
options.c_lflag = 0;