From 294fe97ae1b8e0b8ec341cb31fb7a5d7fd02066a Mon Sep 17 00:00:00 2001 From: schodet Date: Sat, 9 Apr 2005 11:46:09 +0000 Subject: Correction du bug du mode RING : les interruptions s'interrompaient elle même. Solution : SIGNAL au lieu de INTERRUPT. --- n/avr/rs232/Makefile | 2 +- n/avr/rs232/avrconfig.h | 4 ++-- n/avr/rs232/rs232.c | 4 ++-- n/avr/rs232/test_rs232.c | 3 +++ 4 files changed, 8 insertions(+), 5 deletions(-) (limited to 'n') 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 + /* +AutoDec */ /* -AutoDec */ int main (void) { + sei (); rs232_init (); rs232_putc ('N'); rs232_putc ('i'); -- cgit v1.2.3