general delay on startup

fix SDCard init message
This commit is contained in:
Oliver Lehmann 2013-05-07 17:38:06 +00:00
parent cecb900c34
commit 2a4105c261
6 changed files with 76 additions and 76 deletions

View File

@ -66,7 +66,6 @@ wdc_if_disk.o \
wdc_par.o \ wdc_par.o \
wdc_ram.o wdc_ram.o
OBJS_AS_ARGS += \ OBJS_AS_ARGS += \
wdc_avr.o \ wdc_avr.o \
wdc_drv_pata.o \ wdc_drv_pata.o \
@ -79,7 +78,6 @@ wdc_if_disk.o \
wdc_par.o \ wdc_par.o \
wdc_ram.o wdc_ram.o
C_DEPS += \ C_DEPS += \
wdc_avr.d \ wdc_avr.d \
wdc_drv_pata.d \ wdc_drv_pata.d \
@ -92,7 +90,6 @@ wdc_if_disk.d \
wdc_par.d \ wdc_par.d \
wdc_ram.d wdc_ram.d
C_DEPS_AS_ARGS += \ C_DEPS_AS_ARGS += \
wdc_avr.d \ wdc_avr.d \
wdc_drv_pata.d \ wdc_drv_pata.d \
@ -105,7 +102,6 @@ wdc_if_disk.d \
wdc_par.d \ wdc_par.d \
wdc_ram.d wdc_ram.d
OUTPUT_FILE_PATH +=P8000_WDC_Emulator.elf OUTPUT_FILE_PATH +=P8000_WDC_Emulator.elf
OUTPUT_FILE_PATH_AS_ARGS +=P8000_WDC_Emulator.elf OUTPUT_FILE_PATH_AS_ARGS +=P8000_WDC_Emulator.elf
@ -140,12 +136,13 @@ LIB_DEP+=
./%.o: .././%.c ./%.o: .././%.c
@echo Building file: $< @echo Building file: $<
@echo Invoking: AVR/GNU C Compiler : @echo Invoking: AVR/GNU C Compiler : 3.4.2
$(QUOTE)C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fpack-struct -fshort-enums -Wall -Wundef -Werror -pedantic -pedantic-errors -mmcu=atmega1284p -c -save-temps -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o"$@" "$<" $(QUOTE)C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.939\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -Wundef -Werror -pedantic -pedantic-errors -mmcu=atmega1284p -c -save-temps -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<"
@echo Finished building: $< @echo Finished building: $<
# AVR32/GNU Preprocessing Assembler # AVR32/GNU Preprocessing Assembler
@ -168,14 +165,15 @@ all: $(OUTPUT_FILE_PATH) $(ADDITIONAL_DEPENDENCIES)
$(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP) $(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP)
@echo Building target: $@ @echo Building target: $@
@echo Invoking: AVR/GNU Linker : @echo Invoking: AVR/GNU Linker : 3.4.2
$(QUOTE)C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -Wl,-Map="P8000_WDC_Emulator.map" -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--gc-sections -mmcu=atmega1284p $(QUOTE)C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.939\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -Wl,-Map="P8000_WDC_Emulator.map" -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--gc-sections -mmcu=atmega1284p
@echo Finished building target: $@ @echo Finished building target: $@
"C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature "P8000_WDC_Emulator.elf" "P8000_WDC_Emulator.hex" "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.939\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature "P8000_WDC_Emulator.elf" "P8000_WDC_Emulator.hex"
"C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex "P8000_WDC_Emulator.elf" "P8000_WDC_Emulator.eep" || exit 0 "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.939\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex "P8000_WDC_Emulator.elf" "P8000_WDC_Emulator.eep" || exit 0
"C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "P8000_WDC_Emulator.elf" > "P8000_WDC_Emulator.lss" "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.939\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "P8000_WDC_Emulator.elf" > "P8000_WDC_Emulator.lss"
"C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O srec -R .eeprom -R .fuse -R .lock -R .signature "P8000_WDC_Emulator.elf" "P8000_WDC_Emulator.srec" "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.939\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O srec -R .eeprom -R .fuse -R .lock -R .signature "P8000_WDC_Emulator.elf" "P8000_WDC_Emulator.srec"
"C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-size.exe" "P8000_WDC_Emulator.elf" "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.939\avr8-gnu-toolchain\bin\avr-size.exe" "P8000_WDC_Emulator.elf"
@ -184,6 +182,7 @@ $(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP)
# Other Targets # Other Targets
clean: clean:
-$(RM) $(OBJS_AS_ARGS)$(C_DEPS_AS_ARGS) $(EXECUTABLES) -$(RM) $(OBJS_AS_ARGS) $(EXECUTABLES)
-$(RM) $(C_DEPS_AS_ARGS)
rm -rf "P8000_WDC_Emulator.elf" "P8000_WDC_Emulator.a" "P8000_WDC_Emulator.hex" "P8000_WDC_Emulator.lss" "P8000_WDC_Emulator.eep" "P8000_WDC_Emulator.map" "P8000_WDC_Emulator.srec" rm -rf "P8000_WDC_Emulator.elf" "P8000_WDC_Emulator.a" "P8000_WDC_Emulator.hex" "P8000_WDC_Emulator.lss" "P8000_WDC_Emulator.eep" "P8000_WDC_Emulator.map" "P8000_WDC_Emulator.srec"

View File

@ -33,6 +33,11 @@
</dependencies> </dependencies>
</framework-data> </framework-data>
</AsfFrameworkConfig> </AsfFrameworkConfig>
<ProgFlashFromRam>true</ProgFlashFromRam>
<RamSnippetAddress>0x20000000</RamSnippetAddress>
<CacheFlash>true</CacheFlash>
<UncachedRange />
<BootSegment>2</BootSegment>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<ToolchainSettings> <ToolchainSettings>

View File

@ -26,7 +26,7 @@
*/ */
/* /*
* $Id: wdc_drv_mmc.c,v 1.23 2013/05/04 21:22:53 olivleh1 Exp $ * $Id: wdc_drv_mmc.c,v 1.24 2013/05/07 17:38:06 olivleh1 Exp $
*/ */
#include <avr/io.h> #include <avr/io.h>
@ -274,6 +274,8 @@ uint8_t mmc_init ()
mmc_enable_crc ( 1 ); mmc_enable_crc ( 1 );
#endif #endif
uart_putstring ( PSTR ( "INFO: SDCard disk has been found" ), true );
disable_mmc(); disable_mmc();
return 0; return 0;
} }
@ -306,10 +308,6 @@ uint8_t mmc_cmd ( uint8_t *cmd )
tmp = recv_byte(); tmp = recv_byte();
} while ( ( tmp & 0x80 ) && --i ); } while ( ( tmp & 0x80 ) && --i );
if ( !tmp ) {
uart_putstring ( PSTR ( "INFO: SDCard disk has been found" ), true );
}
return tmp; return tmp;
} }

View File

@ -26,12 +26,11 @@
*/ */
/* /*
* $Id: wdc_drv_pata.c,v 1.13 2013/05/04 21:29:43 olivleh1 Exp $ * $Id: wdc_drv_pata.c,v 1.14 2013/05/07 17:38:06 olivleh1 Exp $
*/ */
#include "wdc_config.h" #include "wdc_config.h"
#include <avr/io.h> #include <avr/io.h>
#include <util/delay.h>
#include "wdc_avr.h" #include "wdc_avr.h"
#include "uart.h" #include "uart.h"
#include "wdc_drv_pata.h" #include "wdc_drv_pata.h"
@ -326,10 +325,6 @@ void ata_identify ()
uint8_t pata_init () uint8_t pata_init ()
{ {
/* is needed for some disks (for example Maxtor 6L080J4) */
_delay_ms ( 400 );
uart_putstring ( PSTR ( "INFO: PATA init start" ), true ); uart_putstring ( PSTR ( "INFO: PATA init start" ), true );
while ( ( !pata_rdy() ) & pata_bsy() ) {} while ( ( !pata_rdy() ) & pata_bsy() ) {}

View File

@ -27,7 +27,7 @@
/* /*
* $Id: wdc_main.c,v 1.33 2013/05/04 21:39:53 olivleh1 Exp $ * $Id: wdc_main.c,v 1.34 2013/05/07 17:38:06 olivleh1 Exp $
* *
*/ */
@ -41,6 +41,7 @@
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <avr/sleep.h> #include <avr/sleep.h>
#include "wdc_config.h" #include "wdc_config.h"
#include <util/delay.h>
#include "wdc_main.h" #include "wdc_main.h"
#ifdef DEBUG #ifdef DEBUG
#include "uart.h" #include "uart.h"
@ -75,9 +76,8 @@ main ( void )
uint8_t errorcode; uint8_t errorcode;
uint8_t i8; uint8_t i8;
#endif #endif
atmega_setup();
uart_putstring ( PSTR ( "=== P8000 WDC Emulator 0.92 ===" ), true ); atmega_setup();
#ifdef MEASURE_DISK_PERFORMANCE #ifdef MEASURE_DISK_PERFORMANCE
measure_performance(); measure_performance();
@ -419,7 +419,10 @@ main ( void )
void atmega_setup ( void ) void atmega_setup ( void )
{ {
set_sleep_mode ( SLEEP_MODE_IDLE ); set_sleep_mode ( SLEEP_MODE_IDLE );
/* is needed for some disks (for example Maxtor 6L080J4) and SD-Cards*/
_delay_ms ( 400 );
uart_init(); uart_init();
uart_putstring ( PSTR ( "=== P8000 WDC Emulator 0.92 ===" ), true );
wdc_init_avr(); wdc_init_avr();
wdc_get_sysconf(); wdc_get_sysconf();