diff --git a/P8000_WDC_Emulator/P8000_WDC_Emulator/Debug/Makefile b/P8000_WDC_Emulator/P8000_WDC_Emulator/Debug/Makefile
index ea33308..68e6d5c 100755
--- a/P8000_WDC_Emulator/P8000_WDC_Emulator/Debug/Makefile
+++ b/P8000_WDC_Emulator/P8000_WDC_Emulator/Debug/Makefile
@@ -37,6 +37,7 @@ SUBDIRS :=
C_SRCS += \
../main.c \
../mmc.c \
+../mmc_perf.c \
../uart.c \
../wdc_if_pio.c \
../wdc_if_sdcard.c \
@@ -53,6 +54,7 @@ ASM_SRCS +=
OBJS += \
main.o \
mmc.o \
+mmc_perf.o \
uart.o \
wdc_if_pio.o \
wdc_if_sdcard.o \
@@ -63,6 +65,7 @@ wdc_ram.o
OBJS_AS_ARGS += \
main.o \
mmc.o \
+mmc_perf.o \
uart.o \
wdc_if_pio.o \
wdc_if_sdcard.o \
@@ -73,6 +76,7 @@ wdc_ram.o
C_DEPS += \
main.d \
mmc.d \
+mmc_perf.d \
uart.d \
wdc_if_pio.d \
wdc_if_sdcard.d \
@@ -83,6 +87,7 @@ wdc_ram.d
C_DEPS_AS_ARGS += \
main.d \
mmc.d \
+mmc_perf.d \
uart.d \
wdc_if_pio.d \
wdc_if_sdcard.d \
@@ -114,6 +119,8 @@ OUTPUT_FILE_DEP:= ./makedep.mk
+
+
./%.o: .././%.c
@echo Building file: $<
@echo Invoking: AVR/GNU C Compiler : (AVR_8_bit_GNU_Toolchain_3.4.0_663) 4.6.2
diff --git a/P8000_WDC_Emulator/P8000_WDC_Emulator/Debug/makedep.mk b/P8000_WDC_Emulator/P8000_WDC_Emulator/Debug/makedep.mk
index 91e0f9c..6a82325 100755
--- a/P8000_WDC_Emulator/P8000_WDC_Emulator/Debug/makedep.mk
+++ b/P8000_WDC_Emulator/P8000_WDC_Emulator/Debug/makedep.mk
@@ -6,6 +6,8 @@ main.c
mmc.c
+mmc_perf.c
+
uart.c
wdc_if_pio.c
diff --git a/P8000_WDC_Emulator/P8000_WDC_Emulator/P8000_WDC_Emulator.cproj b/P8000_WDC_Emulator/P8000_WDC_Emulator/P8000_WDC_Emulator.cproj
index 0f67627..b427cd0 100644
--- a/P8000_WDC_Emulator/P8000_WDC_Emulator/P8000_WDC_Emulator.cproj
+++ b/P8000_WDC_Emulator/P8000_WDC_Emulator/P8000_WDC_Emulator.cproj
@@ -45,30 +45,30 @@
- True
- True
- True
- True
- True
- Optimize (-O1)
- True
- True
- True
- True
- True
- True
- True
- True
- -std=c99
- True
-
-
- m
-
-
- True
- True
-
+ True
+ True
+ True
+ True
+ True
+ Optimize (-O1)
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ -std=c99
+ True
+
+
+ m
+
+
+ True
+ True
+
@@ -87,6 +87,9 @@
compile
+
+ compile
+
compile
diff --git a/P8000_WDC_Emulator/P8000_WDC_Emulator/wdc_config.h b/P8000_WDC_Emulator/P8000_WDC_Emulator/wdc_config.h
index 76376b2..96dab9b 100644
--- a/P8000_WDC_Emulator/P8000_WDC_Emulator/wdc_config.h
+++ b/P8000_WDC_Emulator/P8000_WDC_Emulator/wdc_config.h
@@ -26,7 +26,7 @@
*/
/*
- * $Id: wdc_config.h,v 1.8 2012/06/07 18:01:02 olivleh1 Exp $
+ * $Id: wdc_config.h,v 1.9 2012/06/07 20:25:46 olivleh1 Exp $
*/
@@ -77,4 +77,8 @@
#define MMC_MULTIBLOCK 1
+#undef MEASURE_SDCARD_TIME
+#define MEASURE_SDCARD_TIME 1
+
+
#endif /* CONFIG_H_ */
\ No newline at end of file
diff --git a/P8000_WDC_Emulator/P8000_WDC_Emulator/wdc_drv_mmc.c b/P8000_WDC_Emulator/P8000_WDC_Emulator/wdc_drv_mmc.c
index 90eb8cf..5e3da21 100644
--- a/P8000_WDC_Emulator/P8000_WDC_Emulator/wdc_drv_mmc.c
+++ b/P8000_WDC_Emulator/P8000_WDC_Emulator/wdc_drv_mmc.c
@@ -26,7 +26,7 @@
*/
/*
- * $Id: wdc_drv_mmc.c,v 1.11 2012/06/07 18:38:08 olivleh1 Exp $
+ * $Id: wdc_drv_mmc.c,v 1.12 2012/06/07 20:25:46 olivleh1 Exp $
*/
#include
@@ -340,12 +340,13 @@ uint8_t mmc_write_sector ( uint32_t addr, uint8_t *buffer )
uint8_t mmc_read_block ( uint8_t *cmd, uint8_t *buffer, uint16_t bytes )
{
uint16_t i = 1;
+uint8_t by;
#ifdef SPI_CRC
uint16_t crc;
#endif
MMC_Enable();
-// wait_till_card_ready();
+ //wait_till_card_ready();
/* send command */
if ( mmc_cmd ( cmd ) != 0 ) {
@@ -362,32 +363,34 @@ uint8_t mmc_read_block ( uint8_t *cmd, uint8_t *buffer, uint16_t bytes )
/* read first byte */
send_dummy_byte();
- *buffer = recv_byte();
+ by = recv_byte();
+ xmit_byte ( 0xff );
/* read the remaining 511 bytes */
do {
- xmit_byte ( 0xff ); /* send dummy byte */
- buffer++;
- wait_till_send_done();
- *buffer = recv_byte();
+ *buffer++ = by;
i++;
+ wait_till_send_done();
+ by = recv_byte();
+ xmit_byte ( 0xff );
} while ( i