Skip to content

Commit

Permalink
Pull request #5 (comment)
Browse files Browse the repository at this point in the history
Bug in ff_getcwd when FF_VOLUMES < 2
  • Loading branch information
carlk3 committed Jun 21, 2021
1 parent bec6354 commit e7a1e96
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
Empty file added .gitmodules
Empty file.
3 changes: 2 additions & 1 deletion FatFs_SPI/sd_driver/sd_card.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,8 @@ static int sd_cmd(sd_card_t *this, const cmdSupported cmd, uint32_t arg,
return SD_BLOCK_DEVICE_ERROR_NO_DEVICE; // No device
}
if (response & R1_COM_CRC_ERROR) {
DBG_PRINTF("CRC error CMD:%d response 0x%" PRIx32 "\n", cmd, response);
if (ACMD23_SET_WR_BLK_ERASE_COUNT != cmd)
DBG_PRINTF("CRC error CMD:%d response 0x%" PRIx32 "\n", cmd, response);
return SD_BLOCK_DEVICE_ERROR_CRC; // CRC error
}
if (response & R1_ILLEGAL_COMMAND) {
Expand Down
2 changes: 2 additions & 0 deletions FatFs_SPI/src/ff_stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ char *ff_getcwd(char *pcBuffer, size_t xBufferLength) {
else
p = buf;
strncpy(pcBuffer, p, xBufferLength);
} else {
strncpy(pcBuffer, buf, xBufferLength);
}
return pcBuffer;
} else {
Expand Down
3 changes: 2 additions & 1 deletion example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.13)

# Pull in Pico SDK (must be before project)
# initialize the SDK based on PICO_SDK_PATH
# note: this must happen before project()
include(pico_sdk_import.cmake)

project(FatFS_SPI_example C CXX ASM)
Expand Down

0 comments on commit e7a1e96

Please sign in to comment.