Skip to content

Commit

Permalink
Debug pulse on SDBG when an SD error occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
erichelgeson committed May 6, 2023
1 parent 39e923d commit 227baab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/BlueSCSI_platform_RP2040/BlueSCSI_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ void platform_init()
bool optionS2 = !gpio_get(SCSI_IN_ACK);

/* Initialize logging to SWO pin (UART0) */
gpio_conf(SWO_PIN, GPIO_FUNC_UART,false,false, true, false, true);
// pin function pup pdown out state fast
gpio_conf(SWO_PIN, GPIO_FUNC_SIO,false,false, true, false, true);
uart_init(uart0, 1000000);
g_uart_initialized = true;
mbed_set_error_hook(mbed_error_hook);
Expand Down
2 changes: 2 additions & 0 deletions lib/BlueSCSI_platform_RP2040/sd_card_sdio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ static uint32_t g_sdio_sector_count;
#define checkReturnOk(call) ((g_sdio_error = (call)) == SDIO_OK ? true : logSDError(__LINE__))
static bool logSDError(int line)
{
sio_hw->gpio_set = 1 << SWO_PIN;
//sio_hw->gpio_clr = 1 << SWO_PIN;
g_sdio_error_line = line;
log("SDIO SD card error on line ", line, ", error code ", (int)g_sdio_error);
return false;
Expand Down

0 comments on commit 227baab

Please sign in to comment.