]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/main.c
printf() --> printf_P(PSTR())
[z180-stamp.git] / avr / main.c
index 5c4cd0c0bca48ebdd29bf0242c67e715df061f5e..c6a0f00929f2d97e7370ba11dbeba4b2f7dfae66 100644 (file)
 #include "cli.h"
 #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;
@@ -92,7 +104,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