diff --git a/P8000_WDC_Emulator/P8000_WDC_Emulator/Makefile b/P8000_WDC_Emulator/P8000_WDC_Emulator/Makefile new file mode 100644 index 0000000..4120010 --- /dev/null +++ b/P8000_WDC_Emulator/P8000_WDC_Emulator/Makefile @@ -0,0 +1,36 @@ +OUTPUT_FILE=P8000_WDC_Emulator +MCU= -mmcu=atmega1284p + +CC=avr-gcc +CFLAGS= -I/usr/local/avr/include -funsigned-char -funsigned-bitfields -O1 \ + -ffunction-sections -fpack-struct -fshort-enums -Wall -Wundef \ + -Werror -pedantic -pedantic-errors -c -std=gnu99 ${MCU} + +LDFLAGS=-Wl,-Map="${OUTPUT_FILE}.map" -Wl,--start-group -Wl,-lm \ + -Wl,--end-group -Wl,--gc-sections -mrelax ${MCU} + +RM := rm -rf + +OBJS += \ +main.o \ +mmc.o \ +uart.o \ +wdc_if_pio.o \ +wdc_if_sdcard.o \ +wdc_par.o \ +wdc_ram.o + + +all: ${OUTPUT_FILE} + +${OUTPUT_FILE}: ${OBJS} + avr-gcc -o${OUTPUT_FILE}.elf ${OBJS} ${LDFLAGS} + avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature "${OUTPUT_FILE}.elf" "${OUTPUT_FILE}.hex" + avr-objcopy -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex "${OUTPUT_FILE}.elf" "${OUTPUT_FILE}.eep" || exit 0 + avr-objdump -h -S "${OUTPUT_FILE}.elf" > "${OUTPUT_FILE}.lss" + avr-size "${OUTPUT_FILE}.elf" + +clean: + -${RM} ${OBJS} + rm -rf "${OUTPUT_FILE}.elf" "${OUTPUT_FILE}.a" "${OUTPUT_FILE}.hex" "${OUTPUT_FILE}.lss" "${OUTPUT_FILE}.eep" "${OUTPUT_FILE}.map" + diff --git a/P8000_WDC_Emulator/P8000_WDC_Emulator/wdc_main.c b/P8000_WDC_Emulator/P8000_WDC_Emulator/wdc_main.c index 6ed12b7..de3053c 100644 --- a/P8000_WDC_Emulator/P8000_WDC_Emulator/wdc_main.c +++ b/P8000_WDC_Emulator/P8000_WDC_Emulator/wdc_main.c @@ -1,7 +1,7 @@ /* * P8000 WDC Emulator * - * $Id: wdc_main.c,v 1.13 2012/06/06 22:05:06 olivleh1 Exp $ + * $Id: wdc_main.c,v 1.14 2012/06/06 23:10:31 olivleh1 Exp $ * * TODO: - Different Errorcodes in the MMC layer (use defines) * - errorchecking in several places @@ -341,7 +341,7 @@ main ( void ) void atmega_setup ( void ) { - // set_sleep_mode ( SLEEP_MODE_IDLE ); + set_sleep_mode ( SLEEP_MODE_IDLE ); uart_init(); wdc_init_ports(); while ( wdc_init_sdcard() ) {