From 7251215f643f50f20ff9475aae221235990329eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Thu, 6 Dec 2012 08:55:50 +0000 Subject: [PATCH] fixed recursive call to disk_initialize() --- SD_CARD/BaS_gcc/bas.lk.in | 5 ++++- SD_CARD/BaS_gcc/sources/BaS.c | 10 ++-------- SD_CARD/BaS_gcc/sources/sd_card.c | 3 ++- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/SD_CARD/BaS_gcc/bas.lk.in b/SD_CARD/BaS_gcc/bas.lk.in index e69f739..21b70f5 100644 --- a/SD_CARD/BaS_gcc/bas.lk.in +++ b/SD_CARD/BaS_gcc/bas.lk.in @@ -12,6 +12,10 @@ SECTIONS objs/startcf.o(.text) /* this one is the entry point so it must be the first */ objs/sysinit.o(.text) objs/init_fpga.o(.text) + objs/sd_card.o(.text) + objs/ff.o(.text) + objs/mmcbb.o(.text) + #if (FORMAT == elf32-m68k) *(.rodata) *(.rodata.*) @@ -32,7 +36,6 @@ SECTIONS objs/bas_printf.o(.text) objs/printf_helper.o(.text) objs/cache.o(.text) - objs/sd_card.o(.text) objs/mmu.o(.text) objs/exceptions.o(.text) objs/supervisor.o(.text) diff --git a/SD_CARD/BaS_gcc/sources/BaS.c b/SD_CARD/BaS_gcc/sources/BaS.c index 5960b58..95ef86d 100644 --- a/SD_CARD/BaS_gcc/sources/BaS.c +++ b/SD_CARD/BaS_gcc/sources/BaS.c @@ -30,6 +30,7 @@ #include "bas_printf.h" #include "bas_types.h" #include "sd_card.h" +#include "diskio.h" #include "ff.h" /* imported routines */ @@ -152,19 +153,12 @@ void nvram_init(void) /********************************************************************/ void BaS(void) { - int az_sectors; uint8_t *src; uint8_t *dst = (uint8_t *)TOS; uint32_t *adr; - az_sectors = spi_init(); - - if (az_sectors > 0) - { - sd_card_idle(); - } - + disk_initialize(0); pic_init(); nvram_init(); diff --git a/SD_CARD/BaS_gcc/sources/sd_card.c b/SD_CARD/BaS_gcc/sources/sd_card.c index b0e9341..3bb0ed8 100644 --- a/SD_CARD/BaS_gcc/sources/sd_card.c +++ b/SD_CARD/BaS_gcc/sources/sd_card.c @@ -28,6 +28,8 @@ #include "sd_card.h" #include "diskio.h" +#define xprintf xprintf_before_copy + /* * "standard value" for DSPI module configuration register MCF_DSPC_DMCR */ @@ -174,7 +176,6 @@ int spi_init(void) wait(10000); //sd_card_idle(); - disk_initialize(0); xprintf("finished\r\n"); return 0;