summaryrefslogtreecommitdiff
path: root/avr/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'avr/main.c')
-rw-r--r--avr/main.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/avr/main.c b/avr/main.c
index 5c4cd0c..c6a0f00 100644
--- a/avr/main.c
+++ b/avr/main.c
@@ -28,6 +28,18 @@
#include "env.h"
/*--------------------------------------------------------------------------*/
+#if DEBUG
+void preset_ram (void) __attribute__ ((naked)) \
+ __attribute__ ((section (".init3")));
+void
+preset_ram (void)
+{
+ for (uint8_t *p = RAMSTART; p <= (uint8_t *) RAMEND; p++)
+ *p = 0xdd;
+
+}
+#endif
+/*--------------------------------------------------------------------------*/
static uint8_t mcusr;
@@ -93,7 +105,6 @@ void print_reset_reason(void)
/*******************************************************************************/
-/*******************************************************************************/
#define udelay(n) _delay_us(n)
@@ -193,14 +204,15 @@ void main_loop(void)
int main(void)
{
+
setup_avr();
z80_setup_bus();
serial_setup();
sei();
- debug("\n=========================< (RE)START DEBUG >=========================\n");
#if DEBUG
+ debug("\n=========================< (RE)START DEBUG >=========================\n");
print_reset_reason();
#endif