diff --git a/BaS_gcc/.cproject b/BaS_gcc/.cproject index 4c1a2a6..051d9c0 100644 --- a/BaS_gcc/.cproject +++ b/BaS_gcc/.cproject @@ -7,7 +7,6 @@ - @@ -21,26 +20,311 @@ + + + + make + + ram + true + true + true + + + make + + clean + true + true + true + + + make + + all + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -51,11 +335,11 @@ - + + + + + make + + ram + true + true + true + + + make + + clean + true + true + true + + + make + + all + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BaS_gcc/.project b/BaS_gcc/.project index 18fee7e..008ae57 100644 --- a/BaS_gcc/.project +++ b/BaS_gcc/.project @@ -7,8 +7,11 @@ org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, + + ?children? + ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|\|| + ?name? @@ -23,12 +26,16 @@ org.eclipse.cdt.make.core.buildArguments - + -j org.eclipse.cdt.make.core.buildCommand make + + org.eclipse.cdt.make.core.buildLocation + ${workspace_loc:/BaS_GNU} + org.eclipse.cdt.make.core.cleanBuildTarget clean @@ -39,7 +46,7 @@ org.eclipse.cdt.make.core.enableAutoBuild - false + true org.eclipse.cdt.make.core.enableCleanBuild @@ -59,7 +66,7 @@ org.eclipse.cdt.make.core.useDefaultBuildCmd - true + false diff --git a/BaS_gcc/Makefile b/BaS_gcc/Makefile index 56ec251..676e5c9 100644 --- a/BaS_gcc/Makefile +++ b/BaS_gcc/Makefile @@ -10,7 +10,7 @@ # can be either "Y" or "N" (without quotes). "Y" for using the m68k-elf-, "N" for using the m68k-atari-mint # toolchain -COMPILE_ELF=N +COMPILE_ELF=Y ifeq (Y,$(COMPILE_ELF)) TCPREFIX=m68k-elf- diff --git a/BaS_gcc/include/sd_card.h b/BaS_gcc/include/sd_card.h index 4af05d2..d7da149 100644 --- a/BaS_gcc/include/sd_card.h +++ b/BaS_gcc/include/sd_card.h @@ -12,11 +12,11 @@ #include -extern int sd_card_init(void); +extern int spi_init(void); extern uint32_t sd_com(uint32_t data); extern void sd_card_idle(void); extern uint8_t sd_card_get_status(void); -extern uint8_t sd_send_byte(uint8_t byte); -extern uint16_t sd_send_word(uint16_t word); +extern uint8_t spi_send_byte(uint8_t byte); +extern uint16_t spi_send_word(uint16_t word); #endif /* _SD_CARD_H_ */ diff --git a/BaS_gcc/sources/BaS.c b/BaS_gcc/sources/BaS.c index da5a608..07600f3 100644 --- a/BaS_gcc/sources/BaS.c +++ b/BaS_gcc/sources/BaS.c @@ -138,7 +138,7 @@ void BaS(void) uint32_t *adr; - az_sectors = sd_card_init(); + az_sectors = spi_init(); if (az_sectors > 0) { diff --git a/BaS_gcc/sources/sd_card.c b/BaS_gcc/sources/sd_card.c index 0b49a96..991f807 100644 --- a/BaS_gcc/sources/sd_card.c +++ b/BaS_gcc/sources/sd_card.c @@ -38,7 +38,7 @@ void sd_card_idle(void) -int sd_card_init(void) +int spi_init(void) { register int ret __asm__("d0"); @@ -78,7 +78,7 @@ uint32_t sd_com(uint32_t data) * initialized previously (either by sd_com or a direct register write). * Returns a byte received from SPI (contents of the RX FIFO). */ -inline uint8_t sd_send_byte(uint8_t byte) +inline uint8_t spi_send_byte(uint8_t byte) { * (volatile uint8_t *) (&MCF_DSPI_DTFR + 3) = byte; @@ -88,14 +88,14 @@ inline uint8_t sd_send_byte(uint8_t byte) /* * as above, but word sized */ -inline uint16_t sd_send_word(uint16_t word) +inline uint16_t spi_send_word(uint16_t word) { * (volatile uint16_t *) (&MCF_DSPI_DTFR + 2) = word; return * (volatile uint16_t *) (&MCF_DSPI_DRFR + 2); } -int sd_card_init(void) +int spi_init(void) { uint32_t ret; uint8_t rb; @@ -134,7 +134,7 @@ int sd_card_init(void) ret = sd_com(MCF_DSPI_DTFR_EOQ | MCF_DSPI_DTFR_CS5 | 0x00FF); for (i = 1; i < 10; i++) { - rb = sd_send_byte(0xff); + rb = spi_send_byte(0xff); } MCF_DSPI_DMCR = DSPI_DMCR_CONF | MCF_DSPI_DMCR_CSIS5; /* CS5 inactive */ @@ -147,7 +147,7 @@ int sd_card_init(void) MCF_DSPI_DMCR = DSPI_DMCR_CONF; ret = sd_com(MCF_DSPI_DTFR_EOQ | MCF_DSPI_DTFR_CS5 | 0x00FF); - rb = sd_send_byte(0xff); + rb = spi_send_byte(0xff); MCF_DSPI_DMCR = DSPI_DMCR_CONF; @@ -168,17 +168,17 @@ void sd_card_idle(void) for (i = 0; i < 100; i++) { - ret = sd_send_byte(0xff); - ret = sd_send_byte(0x40); - ret = sd_send_byte(0x00); - ret = sd_send_byte(0x00); - ret = sd_send_byte(0x00); - ret = sd_send_byte(0x00); - ret = sd_send_byte(0x95); + ret = spi_send_byte(0xff); + ret = spi_send_byte(0x40); + ret = spi_send_byte(0x00); + ret = spi_send_byte(0x00); + ret = spi_send_byte(0x00); + ret = spi_send_byte(0x00); + ret = spi_send_byte(0x95); for (j = 0; j < 6; j++) { - ret = sd_send_byte(0xff); + ret = spi_send_byte(0xff); if (ret & 0x01) break; } @@ -193,13 +193,13 @@ void sd_card_read_ic(void) while (/* no suitable data received */ 1) { - rb = sd_send_byte(0xFF); - rb = sd_send_byte(0x48); - rb = sd_send_byte(0x00); - rb = sd_send_byte(0x00); - rb = sd_send_byte(0x01); - rb = sd_send_byte(0xaa); - rb = sd_send_byte(0x87); + rb = spi_send_byte(0xFF); + rb = spi_send_byte(0x48); + rb = spi_send_byte(0x00); + rb = spi_send_byte(0x00); + rb = spi_send_byte(0x01); + rb = spi_send_byte(0xaa); + rb = spi_send_byte(0x87); rb = sd_card_get_status(); @@ -207,13 +207,13 @@ void sd_card_read_ic(void) { while (rb == 5) { - rb = sd_send_byte(0xff); - rb = sd_send_byte(0x7a); - rb = sd_send_byte(0x00); - rb = sd_send_byte(0x00); - rb = sd_send_byte(0x00); - rb = sd_send_byte(0x00); - rb = sd_send_byte(0x01); + rb = spi_send_byte(0xff); + rb = spi_send_byte(0x7a); + rb = spi_send_byte(0x00); + rb = spi_send_byte(0x00); + rb = spi_send_byte(0x00); + rb = spi_send_byte(0x00); + rb = spi_send_byte(0x01); rb = sd_card_get_status(); } } @@ -225,7 +225,7 @@ void sd_card_read_ic(void) { continue; } - rb = sd_send_byte(0xff); + rb = spi_send_byte(0xff); /* move.b d5,d0 ? */ } } @@ -236,7 +236,7 @@ uint8_t sd_card_get_status(void) do { - ret = sd_send_byte(0xFF); + ret = spi_send_byte(0xFF); } while (ret == 0xff); return ret;