From 883f5aae494ab066938b0cebb554a1ee13766713 Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Thu, 26 Jun 2014 20:39:38 +0200 Subject: [PATCH] fat: fix configuration for this hardware --- sd_raw_config.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sd_raw_config.h b/sd_raw_config.h index 23c4959..777d8d1 100644 --- a/sd_raw_config.h +++ b/sd_raw_config.h @@ -65,12 +65,23 @@ extern "C" * Set to 1 to support so-called SDHC memory cards, i.e. SD * cards with more than 2 gigabytes of memory. */ -#define SD_RAW_SDHC 0 +#define SD_RAW_SDHC 1 /** * @} */ +#define zer0 +#ifdef zer0 + #define configure_pin_mosi() DDRB |= (1 << DDB5) + #define configure_pin_sck() DDRB |= (1 << DDB7) + #define configure_pin_ss() DDRC |= (1 << DDC6) + #define configure_pin_miso() DDRB &= ~(1 << DDB6) + +#define select_card() PORTC &= ~(1 << PORTC6) +#define unselect_card() PORTC |= (1 << PORTC6) + +#else /* defines for customisation of sd/mmc port access */ #if defined(__AVR_ATmega8__) || \ defined(__AVR_ATmega48__) || \ @@ -109,12 +120,13 @@ extern "C" #else #error "no sd/mmc pin mapping available!" #endif +#endif -#define configure_pin_available() DDRC &= ~(1 << DDC4) -#define configure_pin_locked() DDRC &= ~(1 << DDC5) +#define configure_pin_available() do {} while (0) // DDRC &= ~(1 << DDC4) +#define configure_pin_locked() do {} while (0) // DDRC &= ~(1 << DDC5) -#define get_pin_available() (PINC & (1 << PINC4)) -#define get_pin_locked() (PINC & (1 << PINC5)) +#define get_pin_available() (0) // (PINC & (1 << PINC4)) +#define get_pin_locked() (1) // (PINC & (1 << PINC5)) #if SD_RAW_SDHC typedef uint64_t offset_t; -- 2.39.5