X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp.git/blobdiff_plain/e4344855b4d5d3edb4a07640a808ba2e0f06914f..8315e7f4ea0204718e520e48a48739fd0371bd28:/avr/main.c diff --git a/avr/main.c b/avr/main.c index 7796a36..450e2ba 100644 --- a/avr/main.c +++ b/avr/main.c @@ -24,6 +24,8 @@ #include "time.h" #include "rtc.h" #include "debug.h" +#include "cmd_fat.h" + uint8_t mcusr __attribute__ ((section (".noinit"))); @@ -31,7 +33,7 @@ uint8_t mcusr __attribute__ ((section (".noinit"))); __attribute__ ((naked)) __attribute__ ((section (".init3"))) void preset_ram (void) { - for (uint8_t *p = RAMSTART; p <= (uint8_t *) RAMEND; p++) + for (uint8_t *p = (uint8_t *) RAMSTART; p <= (uint8_t *) RAMEND; p++) *p = 0xdd; } @@ -146,16 +148,6 @@ void setup_system_time(void) } - -static void setup_fatfs(void) -{ - static FATFS FatFs0; - static FATFS FatFs1; - - f_mount(&FatFs0, "0:", 0); - f_mount(&FatFs1, "1:", 0); -} - /*--------------------------------------------------------------------------*/ /* Stored value of bootdelay, used by autoboot_command() */ @@ -223,7 +215,7 @@ const char *bootdelay_process(void) debug("### main_loop entered: bootdelay=%d\n\n", bootdelay); _delay_ms(20); - s = getenv_char(PSTR(ENV_BOOTCMD)); + s = getenv_str(PSTR(ENV_BOOTCMD)); stored_bootdelay = bootdelay; return s; } @@ -254,6 +246,7 @@ int main(void) { extern void setup_mmc(void); + __malloc_margin = CONFIG_SYS_MALLOC_MARGIN; setup_avr(); for (int i = 0; i < GPIO_MAX; i++) gpio_config(i, INPUT_PULLUP);