Skip to content

Commit

Permalink
Unconditionally print "No SD card detected!" error message
Browse files Browse the repository at this point in the history
  • Loading branch information
carlk3 committed Sep 12, 2021
1 parent 1c586ec commit 5bae2c9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions FatFs_SPI/sd_driver/sd_card.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,6 @@ typedef enum {

#define SPI_CMD(x) (0x40 | (x & 0x3f))

static bool driver_initialized;

static uint8_t sd_cmd_spi(sd_card_t *pSD, cmdSupported cmd, uint32_t arg) {
uint8_t response;
char cmdPacket[PACKET_SIZE];
Expand Down Expand Up @@ -555,7 +553,7 @@ bool sd_card_detect(sd_card_t *pSD) {
// The socket is now empty
pSD->m_Status |= (STA_NODISK | STA_NOINIT);
pSD->card_type = SDCARD_NONE;
TRACE_PRINTF("No SD card detected!\n");
printf("No SD card detected!\n");
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion dynamic_config_example/dynamic_config_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int main() {
p_sd_card->card_detect_gpio = 14; // Card detect
// What the GPIO read returns when a card is
// present. Use -1 if there is no card detect.
p_sd_card->card_detected_true = 1;
p_sd_card->card_detected_true = 0;
// State attributes:
p_sd_card->m_Status = STA_NOINIT;
p_sd_card->sectors = 0;
Expand Down
2 changes: 1 addition & 1 deletion example/hw_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static sd_card_t sd_cards[] = { // One for each SD card
.spi = &spis[0], // Pointer to the SPI driving this card
.ss_gpio = 15, // The SPI slave select GPIO for this SD card
.card_detect_gpio = 14, // Card detect
.card_detected_true = 1, // What the GPIO read returns when a card is
.card_detected_true = 0, // What the GPIO read returns when a card is
// present. Use -1 if there is no card detect.
// Following attributes are dynamically assigned
.m_Status = STA_NOINIT,
Expand Down

0 comments on commit 5bae2c9

Please sign in to comment.