X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Fser_avr.c;h=646f3fe8d7c48c8a37e52fbe5fd38399704e6c39;hb=b4e1c52676ca63fb01e49a26a3411838e5277d6a;hp=aa239de4af9f038426fca84fccfbcc7b0c25c013;hpb=8940ced6ca2c4d2efb74cbdbfbdd033e0adf9200;p=bertos.git diff --git a/drv/ser_avr.c b/drv/ser_avr.c index aa239de4..646f3fe8 100755 --- a/drv/ser_avr.c +++ b/drv/ser_avr.c @@ -38,6 +38,12 @@ /*#* *#* $Log$ + *#* Revision 1.26 2005/04/11 19:10:27 bernie + *#* Include top-level headers from cfg/ subdir. + *#* + *#* Revision 1.25 2005/01/25 08:37:26 bernie + *#* CONFIG_SER_HWHANDSHAKE fixes. + *#* *#* Revision 1.24 2005/01/14 00:49:16 aleph *#* Rename callbacks; SerialHardwareVT.txSending: New callback; Add SPI_BUS macros. *#* @@ -108,10 +114,10 @@ #include "ser.h" #include "ser_p.h" -#include "config.h" +#include #include "hw.h" /* Required for bus macros overrides */ -#include +#include #include #include @@ -119,23 +125,17 @@ #include -/*! - * \name Hardware handshake (RTS/CTS). - * \{ - */ -#ifndef RTS_ON -#define RTS_ON do {} while (0) -#endif -#ifndef RTS_OFF -#define RTS_OFF do {} while (0) -#endif -#ifndef IS_CTS_ON -#define IS_CTS_ON true -#endif -#ifndef EIMSKB_CTS -#define EIMSKB_CTS 0 /*!< Dummy value, must be overridden */ +#if !CONFIG_SER_HWHANDSHAKE + /*! + * \name Hardware handshake (RTS/CTS). + * \{ + */ + #define RTS_ON do {} while (0) + #define RTS_OFF do {} while (0) + #define IS_CTS_ON true + #define EIMSKF_CTS 0 /*!< Dummy value, must be overridden */ + /*\}*/ #endif -/*\}*/ /*! @@ -436,7 +436,7 @@ static void uart0_setbaudrate(UNUSED_ARG(struct SerialHardware *, _hw), unsigned /* Compute baud-rate period */ uint16_t period = (((CLOCK_FREQ / 16UL) + (rate / 2)) / rate) - 1; -#ifndef __AVR_ATmega103__ +#if !CPU_AVR_ATMEGA103 UBRR0H = (period) >> 8; #endif UBRR0L = (period); @@ -673,7 +673,7 @@ SIGNAL(SIG_CTS) { // Re-enable UDR empty interrupt and TX, then disable CTS interrupt UCSR0B = BV(RXCIE) | BV(UDRIE) | BV(RXEN) | BV(TXEN); - cbi(EIMSK, EIMSKB_CTS); + EIMSK &= ~EIMSKF_CTS; } #endif // CONFIG_SER_HWHANDSHAKE @@ -701,8 +701,8 @@ SIGNAL(SIG_UART0_DATA) // Disable rx interrupt and tx, enable CTS interrupt // UNTESTED UCSR0B = BV(RXCIE) | BV(RXEN) | BV(TXEN); - sbi(EIFR, EIMSKB_CTS); - sbi(EIMSK, EIMSKB_CTS); + EIFR |= EIMSKF_CTS; + EIMSK |= EIMSKF_CTS; } #endif else @@ -772,8 +772,8 @@ SIGNAL(SIG_UART1_DATA) // Disable rx interrupt and tx, enable CTS interrupt // UNTESTED UCSR1B = BV(RXCIE) | BV(RXEN) | BV(TXEN); - sbi(EIFR, EIMSKB_CTS); - sbi(EIMSK, EIMSKB_CTS); + EIFR |= EIMSKF_CTS; + EIMSK |= EIMSKF_CTS; } #endif else