refactored printIntegerInBase to work without a buffer + minor cleanup

This commit is contained in:
Simen Svale Skogsrud
2011-06-03 21:50:02 +02:00
parent 69be1240be
commit f0843db46e
4 changed files with 15 additions and 13 deletions

View File

@ -23,6 +23,7 @@
#include <avr/interrupt.h>
#include <avr/sleep.h>
#include "serial.h"
#ifdef __AVR_ATmega328P__
@ -97,7 +98,7 @@ uint8_t serial_read()
{
if (rx_buffer_head != rx_buffer_tail) {
// Return magic number if no data pending
return 0xff;
return SERIAL_NO_DATA;
} else {
uint8_t data = rx_buffer[rx_buffer_tail];
rx_buffer_tail = (rx_buffer_tail + 1) % RX_BUFFER_SIZE;