Jelajahi Sumber

Fixing up some things that cause crashes

androda 2 tahun lalu
induk
melakukan
30ce435f09

+ 3 - 0
lib/BlueSCSI_platform_RP2040/BlueSCSI_platform.cpp

@@ -12,6 +12,7 @@
 #include <hardware/adc.h>
 #include <hardware/flash.h>
 #include <hardware/structs/xip_ctrl.h>
+#ifdef MBED
 #include <hardware/structs/usb.h>
 #include <platform/mbed_error.h>
 #include <multicore.h>
@@ -20,6 +21,7 @@
 #include "scsi_accel_rp2040.h"
 
 extern "C" {
+#include <pico/cyw43_arch.h>
 
 const char *g_platform_name = PLATFORM_NAME;
 static bool g_scsi_initiator = false;
@@ -900,3 +902,4 @@ mbed::FileHandle *mbed::mbed_override_console(int fd)
 {
     return &g_LogTarget;
 }
+#endif

+ 3 - 2
lib/BlueSCSI_platform_RP2040/BlueSCSI_platform_gpio.h

@@ -3,6 +3,7 @@
 #pragma once
 
 #include <hardware/gpio.h>
+#include <pico/cyw43_arch.h>
 
 // SCSI data input/output port.
 // The data bus uses external bidirectional buffer, with
@@ -53,8 +54,8 @@
 
 // Status LED pins
 #define LED_PIN      25
-#define LED_ON()     sio_hw->gpio_set = 1 << LED_PIN
-#define LED_OFF()    sio_hw->gpio_clr = 1 << LED_PIN
+#define LED_ON()     cyw43_gpio_set(&cyw43_state, 0, true)  //sio_hw->gpio_set = 1 << LED_PIN
+#define LED_OFF()    cyw43_gpio_set(&cyw43_state, 0, false)  //sio_hw->gpio_clr = 1 << LED_PIN
 
 // SDIO and SPI block
 #define SD_SPI_SCK   10

+ 4 - 4
lib/BlueSCSI_platform_RP2040/scsi_accel_rp2040.cpp

@@ -38,10 +38,10 @@
 // B: Lookup from g_scsi_parity_check_lookup and copy to scsi_read_parity PIO
 // C: Addresses from scsi_accel_read PIO to lookup DMA READ_ADDR register
 // D: From pacer to data state machine to trigger transfers
-#define SCSI_DMA_CH_A 0
-#define SCSI_DMA_CH_B 1
-#define SCSI_DMA_CH_C 2
-#define SCSI_DMA_CH_D 3
+#define SCSI_DMA_CH_A 4
+#define SCSI_DMA_CH_B 5
+#define SCSI_DMA_CH_C 6
+#define SCSI_DMA_CH_D 7
 
 static struct {
     uint8_t *app_buf; // Buffer provided by application