#include "main.h"\r
#include "cmdline.h"\r
\r
-volatile uint16_t global_ms;\r
-struct callout_manager cm;\r
-\r
-\r
/** LUFA CDC Class driver interface configuration and state information. This structure is\r
* passed to all CDC Class driver functions, so that multiple instances of the same class\r
* within a device can be differentiated from one another. This is for the first CDC interface,\r
};\r
\r
\r
-/* return time in milliseconds on unsigned 16 bits */\r
-static uint16_t get_time_ms(void)\r
-{\r
- return global_ms;\r
-}\r
-\r
-static void do_led_blink(struct callout_manager *cm,\r
- struct callout *clt, void *dummy)\r
-{\r
- static uint8_t a = 0;\r
-\r
- if (a & 1)\r
- LEDs_SetAllLEDs(0);\r
- else\r
- LEDs_SetAllLEDs(0xff);\r
- a++;\r
-}\r
-\r
-static void increment_ms(void *dummy)\r
-{\r
- global_ms++;\r
-}\r
-\r
-static void main_timer_interrupt(void)\r
-{\r
- static uint8_t cpt = 0;\r
- cpt++;\r
- sei();\r
- if ((cpt & 0x3) == 0)\r
- scheduler_interrupt();\r
-}\r
-\r
-\r
-/** Main program entry point. This routine contains the overall program flow, including initial\r
- * setup of all components and the main program loop.\r
- */\r
-int main(void)\r
-{\r
- struct callout t1;\r
- FILE *xbee_file;\r
- int8_t err;\r
- struct xbee_dev dev;\r
-\r
- SetupHardware();\r
-\r
- LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
-\r
- fdevopen(usbserial1_dev_send, usbserial1_dev_recv);\r
- xbee_file = fdevopen(usbserial2_dev_send, usbserial2_dev_recv);\r
- scheduler_init();\r
- timer_init();\r
- timer0_register_OV_intr(main_timer_interrupt);\r
- sei();\r
-\r
- scheduler_add_periodical_event_priority(increment_ms, NULL,\r
- 1000L / SCHEDULER_UNIT,\r
- LED_PRIO);\r
- cmdline_init();\r
- callout_manager_init(&cm, get_time_ms);\r
- callout_reset(&cm, &t1, 500, PERIODICAL, do_led_blink, NULL);\r
-\r
- /* initialize libxbee */\r
- err = xbee_init();\r
- if (err < 0)\r
- return -1;\r
-\r
- xbee_dev = &dev;\r
-\r
- /* open xbee device */\r
- if (xbee_open(xbee_dev, xbee_file) < 0)\r
- return -1;\r
-\r
- /* register default channel with a callback */\r
- if (xbee_register_channel(xbee_dev, XBEE_DEFAULT_CHANNEL,\r
- xbee_rx, NULL) < 0) {\r
- fprintf(stderr, "cannot register default channel\n");\r
- return -1;\r
- }\r
-\r
- sei();\r
- xbee_mainloop();\r
- return 0;\r
-}\r
-\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */\r
void SetupHardware(void)\r
{\r
#undef CONFIG_MCU_ATMEGA2560
#undef CONFIG_MCU_ATMEGA256
#define CONFIG_MCU_ATMEGAUSB1287
-#define CONFIG_QUARTZ (16000000)
+#define CONFIG_QUARTZ (8000000)
/*
* Generation options
--- /dev/null
+/* Default linker script, for normal executables */
+OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr")
+OUTPUT_ARCH(avr:6)
+MEMORY
+{
+ text (rx) : ORIGIN = 0, LENGTH = 1024K
+ data (rw!x) : ORIGIN = 0x800200, LENGTH = 0xfe00
+ eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 64K
+ fuse (rw!x) : ORIGIN = 0x820000, LENGTH = 1K
+ lock (rw!x) : ORIGIN = 0x830000, LENGTH = 1K
+ signature (rw!x) : ORIGIN = 0x840000, LENGTH = 1K
+}
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ .hash : { *(.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text :
+ {
+ *(.rel.text)
+ *(.rel.text.*)
+ *(.rel.gnu.linkonce.t*)
+ }
+ .rela.text :
+ {
+ *(.rela.text)
+ *(.rela.text.*)
+ *(.rela.gnu.linkonce.t*)
+ }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata :
+ {
+ *(.rel.rodata)
+ *(.rel.rodata.*)
+ *(.rel.gnu.linkonce.r*)
+ }
+ .rela.rodata :
+ {
+ *(.rela.rodata)
+ *(.rela.rodata.*)
+ *(.rela.gnu.linkonce.r*)
+ }
+ .rel.data :
+ {
+ *(.rel.data)
+ *(.rel.data.*)
+ *(.rel.gnu.linkonce.d*)
+ }
+ .rela.data :
+ {
+ *(.rela.data)
+ *(.rela.data.*)
+ *(.rela.gnu.linkonce.d*)
+ }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.bss : { *(.rel.bss) }
+ .rela.bss : { *(.rela.bss) }
+ .rel.plt : { *(.rel.plt) }
+ .rela.plt : { *(.rela.plt) }
+ /* Internal text space or external memory. */
+ .text :
+ {
+ *(.vectors)
+ KEEP(*(.vectors))
+ . = 256 + ALIGN(256); /* placeholder for misc microb infos */
+ /* For data that needs to reside in the lower 64k of progmem. */
+ *(.progmem.gcc*)
+ *(.progmem*)
+ . = ALIGN(2048);
+ __trampolines_start = . ;
+ /* The jump trampolines for the 16-bit limited relocs will reside here. */
+ *(.trampolines)
+ *(.trampolines*)
+ __trampolines_end = . ;
+ /* For future tablejump instruction arrays for 3 byte pc devices.
+ We don't relax jump/call instructions within these sections. */
+ *(.jumptables)
+ *(.jumptables*)
+ /* For code that needs to reside in the lower 128k progmem. */
+ *(.lowtext)
+ *(.lowtext*)
+ __ctors_start = . ;
+ *(.ctors)
+ __ctors_end = . ;
+ __dtors_start = . ;
+ *(.dtors)
+ __dtors_end = . ;
+ KEEP(SORT(*)(.ctors))
+ KEEP(SORT(*)(.dtors))
+ /* From this point on, we don't bother about wether the insns are
+ below or above the 16 bits boundary. */
+ *(.init0) /* Start here after reset. */
+ KEEP (*(.init0))
+ *(.init1)
+ KEEP (*(.init1))
+ *(.init2) /* Clear __zero_reg__, set up stack pointer. */
+ KEEP (*(.init2))
+ *(.init3)
+ KEEP (*(.init3))
+ *(.init4) /* Initialize data and BSS. */
+ KEEP (*(.init4))
+ *(.init5)
+ KEEP (*(.init5))
+ *(.init6) /* C++ constructors. */
+ KEEP (*(.init6))
+ *(.init7)
+ KEEP (*(.init7))
+ *(.init8)
+ KEEP (*(.init8))
+ *(.init9) /* Call main(). */
+ KEEP (*(.init9))
+ *(.text.*) /* trucs de gcc ? */
+ . = ALIGN(2048);
+ /* some libc stuff */
+ strc*(.text)
+ mem*(.text)
+ printf*(.text)
+ vfprintf*(.text)
+ sprintf*(.text)
+ snprintf*(.text)
+ malloc*(.text)
+ free*(.text)
+ fdevopen*(.text)
+ fputc*(.text)
+ . = ALIGN(2048);
+ uart*(.text)
+ pwm*(.text)
+ parse*(.text)
+ rdline*(.text)
+ vt100*(.text)
+ scheduler*(.text)
+ control_system*(.text)
+ pid*(.text)
+ f08*(.text)
+ f16*(.text)
+ f32*(.text)
+ f64*(.text)
+ vect2*(.text)
+ quadramp*(.text)
+ blocking*(.text)
+ obstacle*(.text)
+ trajectory*(.text)
+ position*(.text)
+ adc*(.text)
+ robot*(.text)
+ error*(.text)
+ encoders*(.text)
+ time*(.text)
+ cirbuf*(.text)
+ i2c*(.text)
+ spi*(.text)
+ ax12*(.text)
+ . = ALIGN(2048);
+ *(.text)
+ . = ALIGN(2);
+ *(.fini9) /* _exit() starts here. */
+ KEEP (*(.fini9))
+ *(.fini8)
+ KEEP (*(.fini8))
+ *(.fini7)
+ KEEP (*(.fini7))
+ *(.fini6) /* C++ destructors. */
+ KEEP (*(.fini6))
+ *(.fini5)
+ KEEP (*(.fini5))
+ *(.fini4)
+ KEEP (*(.fini4))
+ *(.fini3)
+ KEEP (*(.fini3))
+ *(.fini2)
+ KEEP (*(.fini2))
+ *(.fini1)
+ KEEP (*(.fini1))
+ *(.fini0) /* Infinite loop after program termination. */
+ KEEP (*(.fini0))
+ _etext = . ;
+ } > text
+ .data : AT (ADDR (.text) + SIZEOF (.text))
+ {
+ PROVIDE (__data_start = .) ;
+ *(.data)
+ *(.data*)
+ *(.rodata) /* We need to include .rodata here if gcc is used */
+ *(.rodata*) /* with -fdata-sections. */
+ *(.gnu.linkonce.d*)
+ . = ALIGN(2);
+ _edata = . ;
+ PROVIDE (__data_end = .) ;
+ } > data
+ .bss SIZEOF(.data) + ADDR(.data) :
+ {
+ PROVIDE (__bss_start = .) ;
+ *(.bss)
+ *(.bss*)
+ *(COMMON)
+ PROVIDE (__bss_end = .) ;
+ } > data
+ __data_load_start = LOADADDR(.data);
+ __data_load_end = __data_load_start + SIZEOF(.data);
+ /* Global data not cleared after reset. */
+ .noinit SIZEOF(.bss) + ADDR(.bss) :
+ {
+ PROVIDE (__noinit_start = .) ;
+ *(.noinit*)
+ PROVIDE (__noinit_end = .) ;
+ _end = . ;
+ PROVIDE (__heap_start = .) ;
+ } > data
+ .eeprom :
+ {
+ *(.eeprom*)
+ __eeprom_end = . ;
+ } > eeprom
+ .fuse :
+ {
+ KEEP(*(.fuse))
+ KEEP(*(.lfuse))
+ KEEP(*(.hfuse))
+ KEEP(*(.efuse))
+ } > fuse
+ .lock :
+ {
+ KEEP(*(.lock*))
+ } > lock
+ .signature :
+ {
+ KEEP(*(.signature*))
+ } > signature
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+}
#include "main.h"
#include "cmdline.h"
-#include "DualVirtualSerial.h"
+#ifdef USE_USB
+#include "DualVirtualSerial.h"
+#endif
-/******** See in commands.c for the list of commands. */
extern parse_pgm_ctx_t main_ctx[];
-int usbserial1_dev_send(char c, FILE* f)
+int cmdline_dev_send(char c, FILE* f)
{
+#ifdef USE_USB
CDC_Device_SendByte(&VirtualSerial1_CDC_Interface, (uint8_t)c);
+#else
+ uart_send(CMDLINE_UART, c);
+#endif
return 0;
}
-int usbserial1_dev_recv(FILE* f)
+int cmdline_dev_recv(FILE* f)
{
int16_t c;
+#ifdef USE_USB
/* non-blocking ! */
c = CDC_Device_ReceiveByte(&VirtualSerial1_CDC_Interface);
+#else
+ c = uart_recv_nowait(CMDLINE_UART);
+#endif
if (c < 0)
return _FDEV_EOF;
}
-int usbserial2_dev_send(char c, FILE* f)
+int xbee_dev_send(char c, FILE* f)
{
+#ifdef USE_USB
CDC_Device_SendByte(&VirtualSerial2_CDC_Interface, (uint8_t)c);
+#else
+ uart_send(XBEE_UART, c);
+#endif
return 0;
}
-int usbserial2_dev_recv(FILE* f)
+int xbee_dev_recv(FILE* f)
{
int16_t c;
+#ifdef USE_USB
/* non-blocking ! */
c = CDC_Device_ReceiveByte(&VirtualSerial2_CDC_Interface);
+#else
+ c = uart_recv_nowait(XBEE_UART);
+#endif
if (c < 0)
return _FDEV_EOF;
return c;
}
-
static void
valid_buffer(const char *buf, uint8_t size)
{
static void write_char(char c)
{
- usbserial1_dev_send(c, NULL);
+ cmdline_dev_send(c, NULL);
}
int8_t ret, same = 0;
int16_t c;
- c = CDC_Device_ReceiveByte(&VirtualSerial1_CDC_Interface);
+ c = cmdline_dev_recv(NULL);
if (c < 0)
return -1;
*/
+#ifdef USE_USB
#include "DualVirtualSerial.h"
+#else
+#define CMDLINE_UART 0
+#define XBEE_UART 2
+#endif
void cmdline_init(void);
/* poll cmdline */
int cmdline_poll(void);
-int usbserial1_dev_send(char c, FILE* f);
-int usbserial1_dev_recv(FILE* f);
+int cmdline_dev_send(char c, FILE* f);
+int cmdline_dev_recv(FILE* f);
-int usbserial2_dev_send(char c, FILE* f);
-int usbserial2_dev_recv(FILE* f);
+int xbee_dev_send(char c, FILE* f);
+int xbee_dev_recv(FILE* f);
static inline uint8_t cmdline_keypressed(void) {
+#ifdef USE_USB
return (CDC_Device_ReceiveByte(&VirtualSerial1_CDC_Interface) >= 0);
+#else
+ return (uart_recv_nowait(CMDLINE_UART) != -1);
+#endif
}
static inline int16_t cmdline_getchar(void) {
+#ifdef USE_USB
return CDC_Device_ReceiveByte(&VirtualSerial1_CDC_Interface);
+#else
+ return uart_recv_nowait(CMDLINE_UART);
+#endif
}
static inline uint8_t cmdline_getchar_wait(void) {
+#ifdef USE_USB
int16_t c;
do {
c = CDC_Device_ReceiveByte(&VirtualSerial1_CDC_Interface);
} while (c < 0);
return c;
+#else
+ return uart_recv(CMDLINE_UART);
+#endif
}
#include "main.h"
struct xbeeboard xbeeboard;
+volatile uint16_t global_ms;
+struct callout_manager cm;
#define TIMEOUT_MS 1000
void bootloader(void)
{
-#define BOOTLOADER_ADDR 0x1e000
+#define BOOTLOADER_ADDR 0x1f800
if (pgm_read_byte_far(BOOTLOADER_ADDR) == 0xff) {
printf_P(PSTR("Bootloader is not present\r\n"));
return;
int16_t c;
/* from xbee to cmdline */
- c = CDC_Device_ReceiveByte(&VirtualSerial2_CDC_Interface);
+ c = xbee_dev_recv(NULL);
if (c >= 0)
- CDC_Device_SendByte(&VirtualSerial1_CDC_Interface,
- (uint8_t)c);
+ cmdline_dev_send((uint8_t)c, NULL);
/* from cmdline to xbee */
- c = CDC_Device_ReceiveByte(&VirtualSerial1_CDC_Interface);
+ c = cmdline_dev_recv(NULL);
if (c == 4) { /* CTRL-d */
xbee_raw = 0;
rdline_newline(&xbeeboard.rdl,
}
else if (c >= 0) {
/* send to xbee */
- CDC_Device_SendByte(&VirtualSerial2_CDC_Interface,
- (uint8_t)c);
+ xbee_dev_send((uint8_t)c, NULL);
+
/* echo on cmdline */
- CDC_Device_SendByte(&VirtualSerial1_CDC_Interface,
- (uint8_t)c);
+ cmdline_dev_send((uint8_t)c, NULL);
}
}
else {
xbee_proto_rx(xbee_dev);
}
+#ifdef USE_USB
CDC_Device_USBTask(&VirtualSerial1_CDC_Interface);
CDC_Device_USBTask(&VirtualSerial2_CDC_Interface);
USB_USBTask();
+#endif
}
}
+
+/* return time in milliseconds on unsigned 16 bits */
+static uint16_t get_time_ms(void)
+{
+ return global_ms;
+}
+
+static void do_led_blink(struct callout_manager *cm,
+ struct callout *clt, void *dummy)
+{
+ static uint8_t a = 0;
+
+#ifdef USE_USB
+ if (a & 1)
+ LEDs_SetAllLEDs(0);
+ else
+ LEDs_SetAllLEDs(0xff);
+#else
+ /* XXX */
+#endif
+ a++;
+}
+
+static void increment_ms(void *dummy)
+{
+ global_ms++;
+}
+
+static void main_timer_interrupt(void)
+{
+ static uint8_t cpt = 0;
+ cpt++;
+ sei();
+ if ((cpt & 0x3) == 0)
+ scheduler_interrupt();
+}
+
+/** Main program entry point. This routine contains the overall program flow, including initial
+ * setup of all components and the main program loop.
+ */
+int main(void)
+{
+ struct callout t1;
+ FILE *xbee_file;
+ int8_t err;
+ struct xbee_dev dev;
+
+#ifdef USE_USB
+ SetupHardware();
+
+ LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
+#else
+ uart_init();
+#endif
+
+ fdevopen(cmdline_dev_send, cmdline_dev_recv);
+ xbee_file = fdevopen(xbee_dev_send, xbee_dev_recv);
+ scheduler_init();
+ timer_init();
+ timer0_register_OV_intr(main_timer_interrupt);
+
+ scheduler_add_periodical_event_priority(increment_ms, NULL,
+ 1000L / SCHEDULER_UNIT,
+ LED_PRIO);
+ cmdline_init();
+#ifndef USE_USB
+ /* in usb mode, it's done in usb callback */
+ rdline_newline(&xbeeboard.rdl, xbeeboard.prompt);
+#endif
+ callout_manager_init(&cm, get_time_ms);
+ callout_reset(&cm, &t1, 500, PERIODICAL, do_led_blink, NULL);
+
+ /* initialize libxbee */
+ err = xbee_init();
+ if (err < 0)
+ return -1;
+
+ xbee_dev = &dev;
+
+ /* open xbee device */
+ if (xbee_open(xbee_dev, xbee_file) < 0)
+ return -1;
+
+ /* register default channel with a callback */
+ if (xbee_register_channel(xbee_dev, XBEE_DEFAULT_CHANNEL,
+ xbee_rx, NULL) < 0) {
+ fprintf(stderr, "cannot register default channel\n");
+ return -1;
+ }
+
+ sei();
+ xbee_mainloop();
+ return 0;
+}
\r
\r
# MCU name\r
+ifneq ($(USE_USB),)\r
MCU = at90usb1287\r
-\r
+else\r
+MCU = atmega2560\r
+endif\r
\r
# Target architecture (see library "Board Types" documentation).\r
ARCH = AVR8\r
# Create the LUFA source path variables by including the LUFA root makefile\r
include $(LUFA_PATH)/LUFA/makefile\r
\r
-\r
-# List C source files here. (C dependencies are automatically generated.)\r
+ifneq ($(USE_USB),)\r
SRC = \\r
$(TARGET).c \\r
Descriptors.c \\r
$(LUFA_SRC_USB) \\r
$(LUFA_SRC_USBCLASS) \\r
+ DualVirtualSerial.c\r
+endif\r
+\r
+# List C source files here. (C dependencies are automatically generated.)\r
+SRC += \\r
cirbuf_add_buf_head.c \\r
cirbuf_add_buf_tail.c \\r
cirbuf_add_head.c \\r
cirbuf_get_buf_tail.c \\r
cirbuf_get_head.c \\r
cirbuf_get_tail.c \\r
- cmdline.c \\r
commands.c \\r
commands_gen.c \\r
- Descriptors.c \\r
- DualVirtualSerial.c \\r
main.c \\r
rc_proto.c \\r
parse.c \\r
parse_neighbor.c \\r
parse_atcmd.c \\r
parse_monitor.c \\r
- time.c\r
+ time.c \\r
+ cmdline.c\r
\r
# List C++ source files here. (C dependencies are automatically generated.)\r
CPPSRC =\r
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))\r
CFLAGS += $(CSTANDARD)\r
CFLAGS += -std=gnu99\r
+ifneq ($(USE_USB),)\r
+CFLAGS += -DUSE_USB\r
+endif\r
\r
\r
#---------------- Compiler Options C++ ----------------\r
LDFLAGS += $(EXTMEMOPTS)\r
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))\r
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)\r
-#LDFLAGS += -T linker_script.x\r
-\r
+ifeq ($(USE_USB),)\r
+LDFLAGS = -T avr6.x\r
+endif\r
\r
\r
#---------------- Programming Options (avrdude) ----------------\r
%.hex: %.elf\r
@echo\r
@echo $(MSG_FLASH) $@\r
+ $(OBJCOPY) -O binary -R .eeprom -R .fuse -R .lock $< $(TARGET).bin\r
$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@\r
\r
%.eep: %.elf\r
#define UART_CONFIG_H\r
\r
/*\r
- * UART1 definitions\r
+ * UART0 definitions\r
*/\r
\r
-/* compile uart1 fonctions, undefine it to pass compilation */\r
-#define UART1_COMPILE\r
+/* compile uart0 fonctions, undefine it to pass compilation */\r
+#define UART0_COMPILE\r
\r
-/* enable uart1 if == 1, disable if == 0 */\r
-#define UART1_ENABLED 1\r
+/* enable uart0 if == 1, disable if == 0 */\r
+#define UART0_ENABLED 1\r
\r
-/* enable uart1 interrupts if == 1, disable if == 0 */\r
-#define UART1_INTERRUPT_ENABLED 1\r
+/* enable uart0 interrupts if == 1, disable if == 0 */\r
+#define UART0_INTERRUPT_ENABLED 1\r
\r
-#define UART1_BAUDRATE 57600\r
+#define UART0_BAUDRATE 57600\r
\r
/*\r
* if you enable this, the maximum baudrate you can reach is\r
* higher, but the precision is lower.\r
*/\r
-#define UART1_USE_DOUBLE_SPEED 1\r
+#define UART0_USE_DOUBLE_SPEED 1\r
\r
-#define UART1_RX_FIFO_SIZE 64\r
-#define UART1_TX_FIFO_SIZE 127\r
-#define UART1_NBITS 8\r
+#define UART0_RX_FIFO_SIZE 64\r
+#define UART0_TX_FIFO_SIZE 127\r
+#define UART0_NBITS 8\r
\r
-#define UART1_PARITY UART_PARTITY_NONE\r
+#define UART0_PARITY UART_PARTITY_NONE\r
\r
-#define UART1_STOP_BIT UART_STOP_BITS_1\r
+#define UART0_STOP_BIT UART_STOP_BITS_1\r
+\r
+/* .... same for uart 1, 2, 3 ... */\r
+\r
+/*\r
+ * UART2 definitions\r
+ */\r
+\r
+/* compile uart2 fonctions, undefine it to pass compilation */\r
+#define UART2_COMPILE\r
+\r
+/* enable uart2 if == 1, disable if == 0 */\r
+#define UART2_ENABLED 1\r
+\r
+/* enable uart2 interrupts if == 1, disable if == 0 */\r
+#define UART2_INTERRUPT_ENABLED 1\r
+\r
+#define UART2_BAUDRATE 9600\r
+\r
+/*\r
+ * if you enable this, the maximum baudrate you can reach is\r
+ * higher, but the precision is lower.\r
+ */\r
+#define UART2_USE_DOUBLE_SPEED 1\r
+\r
+#define UART2_RX_FIFO_SIZE 64\r
+#define UART2_TX_FIFO_SIZE 127\r
+#define UART2_NBITS 8\r
+\r
+#define UART2_PARITY UART_PARTITY_NONE\r
+\r
+#define UART2_STOP_BIT UART_STOP_BITS_1\r
\r
/* .... same for uart 1, 2, 3 ... */\r
\r