Commit 91732f87fc955cf93ab83f8fc955b97986e53ff2
authorMichel Pollet <buserror@gmail.com>
Tue, 15 Dec 2009 21:42:25 +0000 (21:42 +0000)
committerMichel Pollet <buserror@gmail.com>
Tue, 15 Dec 2009 21:42:25 +0000 (21:42 +0000)
Example firmware declares two traces that will generate a
trace file automaticaly when run with run_avr. The file is
created at load time using the .mmcu declarations.

Signed-off-by: Michel Pollet <buserror@gmail.com>
tests/atmega88_example.c

index fd15e94a047861926119bd03d08f62045a80bd76..21dbd8c2d42d67528b583c139fdefe2516ffa44a 100644 (file)
 #include "avr_mcu_section.h"
 AVR_MCU(F_CPU, "atmega88");
 
+/*
+ * This small section tells simavr to generate a VCD trace dump with changes to these
+ * registers.
+ * Opening it with gtkwave will show you the data being pumped out into the data register
+ * UDR0, and the UDRE0 bit being set, then cleared
+ */
+const struct avr_mmcu_vcd_trace_t _mytrace[]  _MMCU_ = {
+       { AVR_MCU_VCD_SYMBOL("UDR0"), .what = (void*)&UDR0, },  
+       { AVR_MCU_VCD_SYMBOL("UDRE0"), .mask = (1 << UDRE0), .what = (void*)&UCSR0A, }, 
+};
+
+
 /* declare this in a .eeprom ELF section */
 uint32_t value EEMEM = 0xdeadbeef;