diff -r 1f045cadf71f Makefile --- a/Makefile Sat Dec 19 12:38:49 2009 +0100 +++ b/Makefile Tue Jan 12 21:58:20 2010 +0100 @@ -25,7 +25,8 @@ rm -rf doc/html flash: $(HEX) - avrdude -y -c avr910 -p $(MCU_AVRDUDE) -U flash:w:$(HEX) + #avrdude -y -c avr910 -p $(MCU_AVRDUDE) -U flash:w:$(HEX) + avrdude -p $(MCU_AVRDUDE) -P usb -c avrispmkII -V -U flash:w:$(HEX) $(HEX): $(OUT) $(OBJCOPY) -R .eeprom -O ihex $< $@ diff -r 1f045cadf71f main.c --- a/main.c Sat Dec 19 12:38:49 2009 +0100 +++ b/main.c Tue Jan 12 21:58:20 2010 +0100 @@ -368,8 +368,9 @@ /* print file contents */ uint8_t buffer[8]; + uint8_t size; uint32_t offset = 0; - while(fat_read_file(fd, buffer, sizeof(buffer)) > 0) + while((size = fat_read_file(fd, buffer, sizeof(buffer))) > 0) { uart_putdw_hex(offset); uart_putc(':'); @@ -378,6 +379,18 @@ uart_putc(' '); uart_putc_hex(buffer[i]); } + + uart_putc(' '); + + /* Display printable characters */ + for(uint8_t i = 0; i < size; ++i) + { + if ((buffer[i] >= 32) && (buffer[i] <= 126)) + uart_putc(buffer[i]); + else + uart_putc('.'); + } + uart_putc('\n'); offset += 8; } diff -r 1f045cadf71f sd_raw_config.h --- a/sd_raw_config.h Sat Dec 19 12:38:49 2009 +0100 +++ b/sd_raw_config.h Tue Jan 12 21:58:20 2010 +0100 @@ -107,11 +107,17 @@ #error "no sd/mmc pin mapping available!" #endif -#define configure_pin_available() DDRC &= ~(1 << DDC4) -#define configure_pin_locked() DDRC &= ~(1 << DDC5) +// From Sparkfun OpenLog +//My 2 hour pitfall: If not using card detect or write protect, assign these values: +//#define configure_pin_available() DDRC &= ~(1 << DDC4) +//#define configure_pin_locked() DDRC &= ~(1 << DDC5) +#define configure_pin_available() //Do nothing +#define configure_pin_locked() //Do nothing -#define get_pin_available() ((PINC >> PC4) & 0x01) -#define get_pin_locked() ((PINC >> PC5) & 0x01) +//#define get_pin_available() ((PINC >> PC4) & 0x01) +//#define get_pin_locked() ((PINC >> PC5) & 0x01) +#define get_pin_available() (0) //Emulate that the card is present +#define get_pin_locked() (1) //Emulate that the card is always unlocked #if SD_RAW_SDHC typedef uint64_t offset_t;