diff --git a/Control/firmware/uart_echo/main.c b/Control/firmware/uart_echo/main.c index 9f89601..e55045f 100755 --- a/Control/firmware/uart_echo/main.c +++ b/Control/firmware/uart_echo/main.c @@ -5,6 +5,7 @@ * Author : jens */ +#include #include #include #include @@ -19,9 +20,12 @@ #include "i2c.h" #include "mcp42x6.h" -#define ARDUINO_NANO +#define ARDUINO_NANO 1 +#define WITH_ADC_EVENTS 0 +#define WITH_COMMAND_EVENTS 0 -#ifdef ARDUINO_NANO +#define PRINT_PROMPT printf("\n:") +#if ARDUINO_NANO #define F_CPU (16000000UL) // MHz #else #define F_CPU (18432000UL) // MHz @@ -37,10 +41,10 @@ static Fifo messageFifo; enum MessageCode { NOP=0, - Command, Uart, Timer, AdcComplete, + Command, Error = 0xFF }; @@ -52,6 +56,7 @@ typedef struct _sMsg_t ISR(ADC_vect) { +#if WITH_ADC_EVENTS int16_t value_low = (int16_t)ADCL; int16_t value_high = (int16_t)ADCH; ADCSRA |= (1<