summaryrefslogtreecommitdiff
path: root/n/avr/rs232
diff options
context:
space:
mode:
authorschodet2005-04-09 11:46:09 +0000
committerschodet2005-04-09 11:46:09 +0000
commit294fe97ae1b8e0b8ec341cb31fb7a5d7fd02066a (patch)
tree2c0953e95d3d78620f38ca2648391af02b985473 /n/avr/rs232
parenta957915d1fc7d5c465e43647bdce04ca8d9e992b (diff)
Correction du bug du mode RING : les interruptions s'interrompaient elle même.
Solution : SIGNAL au lieu de INTERRUPT.
Diffstat (limited to 'n/avr/rs232')
-rw-r--r--n/avr/rs232/Makefile2
-rw-r--r--n/avr/rs232/avrconfig.h4
-rw-r--r--n/avr/rs232/rs232.c4
-rw-r--r--n/avr/rs232/test_rs232.c3
4 files changed, 8 insertions, 5 deletions
diff --git a/n/avr/rs232/Makefile b/n/avr/rs232/Makefile
index d1e82f2..34c3b9e 100644
--- a/n/avr/rs232/Makefile
+++ b/n/avr/rs232/Makefile
@@ -1,5 +1,5 @@
PROGS = test_rs232
-test_rs232_OBJECTS = test_rs232.c rs232.c
+test_rs232_OBJECTS = test_rs232.o rs232.o
DOC = rs232.html
EXTRACTDOC = rs232.c avrconfig.h
MODULES =
diff --git a/n/avr/rs232/avrconfig.h b/n/avr/rs232/avrconfig.h
index da0a805..6e6e19f 100644
--- a/n/avr/rs232/avrconfig.h
+++ b/n/avr/rs232/avrconfig.h
@@ -36,9 +36,9 @@
/** Send mode :
* - POLLING : no interrupts;
* - RING : interrupts, ring buffer. */
-#define AC_RS232_SEND_MODE POLLING
+#define AC_RS232_SEND_MODE RING
/** Recv mode, same as send mode. */
-#define AC_RS232_RECV_MODE POLLING
+#define AC_RS232_RECV_MODE RING
/** Character size : 5, 6, 7, 8, 9 (only 8 implemented). */
#define AC_RS232_CHAR_SIZE 8
/** Parity : ODD, EVEN, NONE. */
diff --git a/n/avr/rs232/rs232.c b/n/avr/rs232/rs232.c
index 5510e45..5d68197 100644
--- a/n/avr/rs232/rs232.c
+++ b/n/avr/rs232/rs232.c
@@ -232,7 +232,7 @@ rs232_poll (void)
#if RECV_MODE == RING
/* Handle received char for ring buffer. */
-INTERRUPT (SIG_UART_RECV)
+SIGNAL (SIG_UART_RECV)
{
uint8_t c;
uint8_t tmphead;
@@ -254,7 +254,7 @@ INTERRUPT (SIG_UART_RECV)
#if SEND_MODE == RING
/** Handle data register empty for ring buffer. */
-INTERRUPT (SIG_UART_DATA)
+SIGNAL (SIG_UART_DATA)
{
uint8_t tmptail;
if (rs232_send_head != rs232_send_tail)
diff --git a/n/avr/rs232/test_rs232.c b/n/avr/rs232/test_rs232.c
index 3771758..c08dcda 100644
--- a/n/avr/rs232/test_rs232.c
+++ b/n/avr/rs232/test_rs232.c
@@ -23,12 +23,15 @@
* }}} */
#include "rs232.h"
+#include <avr/interrupt.h>
+
/* +AutoDec */
/* -AutoDec */
int
main (void)
{
+ sei ();
rs232_init ();
rs232_putc ('N');
rs232_putc ('i');