From e59951c8ae87d6a958e3ef6bee102a35281b2833 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sat, 11 Jun 2016 16:09:33 -0400 Subject: [PATCH] avr/serial: Separate out low-level hardware manipulation to its own function Introduce enable_tx_irq() for manipulating the AVR hardware. This keeps the low-level hardware code together. Signed-off-by: Kevin O'Connor --- src/avr/serial.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/avr/serial.c b/src/avr/serial.c index 0a7a9508..c1882a5d 100644 --- a/src/avr/serial.c +++ b/src/avr/serial.c @@ -63,6 +63,13 @@ ISR(USART0_UDRE_vect) UDR0 = transmit_buf[transmit_pos++]; } +// Enable tx interrupts +static void +enable_tx_irq(void) +{ + UCSR0B |= 1<