Эх сурвалжийг харах

Debug pulse on SDBG when an SD error occurs

Eric Helgeson 2 жил өмнө
parent
commit
227baab4b6

+ 2 - 1
lib/BlueSCSI_platform_RP2040/BlueSCSI_platform.cpp

@@ -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);

+ 2 - 0
lib/BlueSCSI_platform_RP2040/sd_card_sdio.cpp

@@ -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;