summaryrefslogtreecommitdiff
path: root/2004/n
diff options
context:
space:
mode:
authorschodet2004-04-22 22:03:31 +0000
committerschodet2004-04-22 22:03:31 +0000
commitde007db397577524add437042c59cc2e224e616b (patch)
treea4f70af4d09b2a1b5ede14afde641b952a26d976 /2004/n
parent925c2e764009ce333edbc2ab80bd266e69ddcddf (diff)
Vitesse 38400.
Petites modifs pour les messages unreliables.
Diffstat (limited to '2004/n')
-rw-r--r--2004/n/asserv/src/main.c2
-rw-r--r--2004/n/asserv/src/serial.c12
2 files changed, 6 insertions, 8 deletions
diff --git a/2004/n/asserv/src/main.c b/2004/n/asserv/src/main.c
index 6a6ddaa..da49814 100644
--- a/2004/n/asserv/src/main.c
+++ b/2004/n/asserv/src/main.c
@@ -55,7 +55,7 @@ A1-5 B2-7 C4-5 D2-6 E0-2
/* Configuration générale. */
#fuses H4,WDT,WDT128,PUT,NOBROWNOUT,NOLVP
#use delay(clock=40000000)
-#use rs232(baud=115200,xmit=PIN_C6,parity=N,rcv=PIN_C7,bits=8)
+#use rs232(baud=38400,xmit=PIN_C6,parity=N,rcv=PIN_C7,bits=8)
#priority RB,RDA,TBE,TIMER2
#include "motor.c"
diff --git a/2004/n/asserv/src/serial.c b/2004/n/asserv/src/serial.c
index add7904..4fb27f7 100644
--- a/2004/n/asserv/src/serial.c
+++ b/2004/n/asserv/src/serial.c
@@ -93,11 +93,8 @@ serial_send ()
if (serial_send_full)
{
/* Efface le tampon non-fiable. */
- if (serial_unreliable_send_full)
- {
- serial_unreliable_send_buf_n = 0;
- serial_unreliable_send_full = 0;
- }
+ serial_unreliable_send_buf_n = 0;
+ serial_unreliable_send_full = 0;
/* Envoie le caractère fiable. */
c = serial_send_buf[serial_send_buf_n++];
putc (c);
@@ -255,8 +252,9 @@ serial_send_char (char c)
void
serial_unreliable_send_char (char c)
{
- /* Drop si une transmission est en cours. */
- if (serial_send_full || serial_unreliable_send_full) return;
+ /* Drop si une transmission est en cours ou si une transmission fiable est
+ * entamée. */
+ if (serial_send_buf_n || serial_unreliable_send_full) return;
/* Ajoute le caractère. */
serial_unreliable_send_buf[serial_unreliable_send_buf_n++] = c;
/* Si fin de buffer, on envois. */