Преглед изворни кода

Debrand bluescsiplatform > platform

androda пре 2 година
родитељ
комит
61aa6567ba

+ 24 - 24
lib/BlueSCSI_platform_RP2040/BlueSCSI_platform.cpp

@@ -18,7 +18,7 @@ extern "C" {
 #include <hardware/flash.h>
 #include "rp2040_flash_do_cmd.h"
 
-const char *g_bluescsiplatform_name = PLATFORM_NAME;
+const char *g_platform_name = PLATFORM_NAME;
 static bool g_scsi_initiator = false;
 static uint32_t g_flash_chip_size = 0;
 static bool g_uart_initialized = false;
@@ -43,7 +43,7 @@ static void gpio_conf(uint gpio, enum gpio_function fn, bool pullup, bool pulldo
     }
 }
 
-void bluescsiplatform_init()
+void platform_init()
 {
     // Make sure second core is stopped
     multicore_reset_core1();
@@ -73,7 +73,7 @@ void bluescsiplatform_init()
     mbed_set_error_hook(mbed_error_hook);
 
     //bluelog("DIP switch settings: debug log ", (int)dbglog, ", termination ", (int)termination);
-    bluelog("Platform: ", g_bluescsiplatform_name);
+    bluelog("Platform: ", g_platform_name);
     bluelog("FW Version: ", g_bluelog_firmwareversion);
 
     g_bluelog_debug = false; // Debug logging can be handled with a debug firmware, very easy to reflash
@@ -151,7 +151,7 @@ static bool read_initiator_dip_switch()
 }
 
 // late_init() only runs in main application, SCSI not needed in bootloader
-void bluescsiplatform_late_init()
+void platform_late_init()
 {
     if (read_initiator_dip_switch())
     {
@@ -229,7 +229,7 @@ void bluescsiplatform_late_init()
     }
 }
 
-bool bluescsiplatform_is_initiator_mode_enabled()
+bool platform_is_initiator_mode_enabled()
 {
     return g_scsi_initiator;
 }
@@ -248,9 +248,9 @@ void platform_disable_led(void)
 extern SdFs SD;
 extern uint32_t __StackTop;
 
-void bluescsiplatform_emergency_log_save()
+void platform_emergency_log_save()
 {
-    bluescsiplatform_set_sd_callback(NULL, NULL);
+    platform_set_sd_callback(NULL, NULL);
 
     SD.begin(SD_CONFIG_CRASH);
     FsFile crashfile = SD.open(CRASHFILE, O_WRONLY | O_CREAT | O_TRUNC);
@@ -275,7 +275,7 @@ void mbed_error_hook(const mbed_error_ctx * error_context)
 {
     bluelog("--------------");
     bluelog("CRASH!");
-    bluelog("Platform: ", g_bluescsiplatform_name);
+    bluelog("Platform: ", g_platform_name);
     bluelog("FW Version: ", g_bluelog_firmwareversion);
     bluelog("error_status: ", (uint32_t)error_context->error_status);
     bluelog("error_address: ", error_context->error_address);
@@ -290,7 +290,7 @@ void mbed_error_hook(const mbed_error_ctx * error_context)
         p += 4;
     }
 
-    bluescsiplatform_emergency_log_save();
+    platform_emergency_log_save();
 
     while (1)
     {
@@ -317,7 +317,7 @@ void mbed_error_hook(const mbed_error_ctx * error_context)
 /*****************************************/
 
 // This function is called for every log message.
-void bluescsiplatform_log(const char *s)
+void platform_log(const char *s)
 {
     if (g_uart_initialized)
     {
@@ -357,7 +357,7 @@ static void watchdog_callback(unsigned alarm_num)
         {
             bluelog("--------------");
             bluelog("WATCHDOG TIMEOUT!");
-            bluelog("Platform: ", g_bluescsiplatform_name);
+            bluelog("Platform: ", g_platform_name);
             bluelog("FW Version: ", g_bluelog_firmwareversion);
             bluelog("GPIO states: out ", sio_hw->gpio_out, " oe ", sio_hw->gpio_oe, " in ", sio_hw->gpio_in);
 
@@ -370,9 +370,9 @@ static void watchdog_callback(unsigned alarm_num)
                 p += 4;
             }
 
-            bluescsiplatform_emergency_log_save();
+            platform_emergency_log_save();
 
-            bluescsiplatform_boot_to_main_firmware();
+            platform_boot_to_main_firmware();
         }
     }
 
@@ -381,7 +381,7 @@ static void watchdog_callback(unsigned alarm_num)
 
 // This function can be used to periodically reset watchdog timer for crash handling.
 // It can also be left empty if the platform does not use a watchdog timer.
-void bluescsiplatform_reset_watchdog()
+void platform_reset_watchdog()
 {
     g_watchdog_timeout = WATCHDOG_CRASH_TIMEOUT;
 
@@ -398,15 +398,15 @@ void bluescsiplatform_reset_watchdog()
 /* Flash reprogramming from bootloader   */
 /*****************************************/
 
-#ifdef BLUESCSIPLATFORM_BOOTLOADER_SIZE
+#ifdef PLATFORM_BOOTLOADER_SIZE
 
 extern uint32_t __real_vectors_start;
 extern uint32_t __StackTop;
 static volatile void *g_bootloader_exit_req;
 
-bool bluescsiplatform_rewrite_flash_page(uint32_t offset, uint8_t buffer[BLUESCSIPLATFORM_FLASH_PAGE_SIZE])
+bool platform_rewrite_flash_page(uint32_t offset, uint8_t buffer[PLATFORM_FLASH_PAGE_SIZE])
 {
-    if (offset == BLUESCSIPLATFORM_BOOTLOADER_SIZE)
+    if (offset == PLATFORM_BOOTLOADER_SIZE)
     {
         if (buffer[3] != 0x20 || buffer[7] != 0x10)
         {
@@ -416,8 +416,8 @@ bool bluescsiplatform_rewrite_flash_page(uint32_t offset, uint8_t buffer[BLUESCS
     }
 
     bluedbg("Writing flash at offset ", offset, " data ", bytearray(buffer, 4));
-    assert(offset % BLUESCSIPLATFORM_FLASH_PAGE_SIZE == 0);
-    assert(offset >= BLUESCSIPLATFORM_BOOTLOADER_SIZE);
+    assert(offset % PLATFORM_FLASH_PAGE_SIZE == 0);
+    assert(offset >= PLATFORM_BOOTLOADER_SIZE);
 
     // Avoid any mbed timer interrupts triggering during the flashing.
     __disable_irq();
@@ -430,11 +430,11 @@ bool bluescsiplatform_rewrite_flash_page(uint32_t offset, uint8_t buffer[BLUESCS
     // flashing, and again after reset to main firmware.
     xip_ctrl_hw->ctrl = 0;
 
-    flash_range_erase(offset, BLUESCSIPLATFORM_FLASH_PAGE_SIZE);
-    flash_range_program(offset, buffer, BLUESCSIPLATFORM_FLASH_PAGE_SIZE);
+    flash_range_erase(offset, PLATFORM_FLASH_PAGE_SIZE);
+    flash_range_program(offset, buffer, PLATFORM_FLASH_PAGE_SIZE);
 
     uint32_t *buf32 = (uint32_t*)buffer;
-    uint32_t num_words = BLUESCSIPLATFORM_FLASH_PAGE_SIZE / 4;
+    uint32_t num_words = PLATFORM_FLASH_PAGE_SIZE / 4;
     for (int i = 0; i < num_words; i++)
     {
         uint32_t expected = buf32[i];
@@ -452,7 +452,7 @@ bool bluescsiplatform_rewrite_flash_page(uint32_t offset, uint8_t buffer[BLUESCS
     return true;
 }
 
-void bluescsiplatform_boot_to_main_firmware()
+void platform_boot_to_main_firmware()
 {
     // To ensure that the system state is reset properly, we perform
     // a SYSRESETREQ and jump straight from the reset vector to main application.
@@ -467,7 +467,7 @@ void btldr_reset_handler()
     if (g_bootloader_exit_req == &g_bootloader_exit_req)
     {
         // Boot to main application
-        application_base = (uint32_t*)(XIP_BASE + BLUESCSIPLATFORM_BOOTLOADER_SIZE);
+        application_base = (uint32_t*)(XIP_BASE + PLATFORM_BOOTLOADER_SIZE);
     }
 
     SCB->VTOR = (uint32_t)application_base;

+ 13 - 13
lib/BlueSCSI_platform_RP2040/BlueSCSI_platform.h

@@ -12,7 +12,7 @@ extern "C" {
 #endif
 
 /* These are used in debug output and default SCSI strings */
-extern const char *g_bluescsiplatform_name;
+extern const char *g_platform_name;
 #define PLATFORM_NAME "BlueSCSI RP2040"
 #define PLATFORM_REVISION "2.0"
 #define PLATFORM_MAX_SCSI_SPEED S2S_CFG_SPEED_SYNC_10
@@ -28,8 +28,8 @@ extern const char *g_bluescsiplatform_name;
 
 // Debug logging function, can be used to print to e.g. serial port.
 // May get called from interrupt handlers.
-void bluescsiplatform_log(const char *s);
-void bluescsiplatform_emergency_log_save();
+void platform_log(const char *s);
+void platform_emergency_log_save();
 
 // Timing and delay functions.
 // Arduino platform already provides these
@@ -49,32 +49,32 @@ static inline void delay_100ns()
 }
 
 // Initialize SD card and GPIO configuration
-void bluescsiplatform_init();
+void platform_init();
 
 // Initialization for main application, not used for bootloader
-void bluescsiplatform_late_init();
+void platform_late_init();
 
 // Disable the status LED
 void platform_disable_led(void);
 
 // Query whether initiator mode is enabled on targets with PLATFORM_HAS_INITIATOR_MODE
-bool bluescsiplatform_is_initiator_mode_enabled();
+bool platform_is_initiator_mode_enabled();
 
 // Setup soft watchdog if supported
-void bluescsiplatform_reset_watchdog();
+void platform_reset_watchdog();
 
 // Set callback that will be called during data transfer to/from SD card.
 // This can be used to implement simultaneous transfer to SCSI bus.
 typedef void (*sd_callback_t)(uint32_t bytes_complete);
-void bluescsiplatform_set_sd_callback(sd_callback_t func, const uint8_t *buffer);
+void platform_set_sd_callback(sd_callback_t func, const uint8_t *buffer);
 
 // Reprogram firmware in main program area.
 #ifndef RP2040_DISABLE_BOOTLOADER
-#define BLUESCSIPLATFORM_BOOTLOADER_SIZE (128 * 1024)
-#define BLUESCSIPLATFORM_FLASH_TOTAL_SIZE (1024 * 1024)
-#define BLUESCSIPLATFORM_FLASH_PAGE_SIZE 4096
-bool bluescsiplatform_rewrite_flash_page(uint32_t offset, uint8_t buffer[BLUESCSIPLATFORM_FLASH_PAGE_SIZE]);
-void bluescsiplatform_boot_to_main_firmware();
+#define PLATFORM_BOOTLOADER_SIZE (128 * 1024)
+#define PLATFORM_FLASH_TOTAL_SIZE (1024 * 1024)
+#define PLATFORM_FLASH_PAGE_SIZE 4096
+bool platform_rewrite_flash_page(uint32_t offset, uint8_t buffer[PLATFORM_FLASH_PAGE_SIZE]);
+void platform_boot_to_main_firmware();
 #endif
 
 // ROM drive in the unused external flash area

+ 1 - 1
lib/BlueSCSI_platform_RP2040/sd_card_sdio.cpp

@@ -33,7 +33,7 @@ static const uint8_t *m_stream_buffer;
 static uint32_t m_stream_count;
 static uint32_t m_stream_count_start;
 
-void bluescsiplatform_set_sd_callback(sd_callback_t func, const uint8_t *buffer)
+void platform_set_sd_callback(sd_callback_t func, const uint8_t *buffer)
 {
     m_stream_callback = func;
     m_stream_buffer = buffer;

+ 1 - 1
lib/BlueSCSI_platform_RP2040/sd_card_spi.cpp

@@ -75,7 +75,7 @@ void sdCsWrite(SdCsPin_t pin, bool level)
 RP2040SPIDriver g_sd_spi_port;
 SdSpiConfig g_sd_spi_config(0, DEDICATED_SPI, SD_SCK_MHZ(25), &g_sd_spi_port);
 
-void bluescsiplatform_set_sd_callback(sd_callback_t func, const uint8_t *buffer)
+void platform_set_sd_callback(sd_callback_t func, const uint8_t *buffer)
 {
 }
 

+ 6 - 6
lib/BlueSCSI_platform_template/BlueSCSI_platform.cpp

@@ -7,20 +7,20 @@
 
 extern "C" {
 
-const char *g_bluescsiplatform_name = PLATFORM_NAME;
+const char *g_platform_name = PLATFORM_NAME;
 
 /***************/
 /* GPIO init   */
 /***************/
 
-void bluescsiplatform_init()
+void platform_init()
 {
     /* Initialize SCSI and SD card pins to required modes.
      * SCSI pins should be inactive / input at this point.
      */
 }
 
-void bluescsiplatform_late_init()
+void platform_late_init()
 {
     /* This function can usually be left empty.
      * It can be used for initialization code that should not run in bootloader.
@@ -42,13 +42,13 @@ void platform_disable_led(void)
 // This function is called for every log message.
 // It can e.g. write the log to serial port in real time.
 // It can also be left empty to use only the debug log file on SD card.
-void bluescsiplatform_log(const char *s)
+void platform_log(const char *s)
 {
 }
 
 // This function can be used to periodically reset watchdog timer for crash handling.
 // It can also be left empty if the platform does not use a watchdog timer.
-void bluescsiplatform_reset_watchdog()
+void platform_reset_watchdog()
 {
 }
 
@@ -105,7 +105,7 @@ const uint32_t g_scsi_out_byte_to_bop[256] =
  */
 SdSpiConfig g_sd_spi_config(0, DEDICATED_SPI, SD_SCK_MHZ(25));
 
-void bluescsiplatform_set_sd_callback(sd_callback_t func, const uint8_t *buffer)
+void platform_set_sd_callback(sd_callback_t func, const uint8_t *buffer)
 {
     /* This function can be left empty.
      * If the platform supports DMA for SD card transfers, this function

+ 6 - 6
lib/BlueSCSI_platform_template/BlueSCSI_platform.h

@@ -15,13 +15,13 @@ extern "C" {
 #endif
 
 /* These are used in debug output and default SCSI strings */
-extern const char *g_bluescsiplatform_name;
+extern const char *g_platform_name;
 #define PLATFORM_NAME "Example"
 #define PLATFORM_REVISION "1.0"
 
 // Debug logging function, can be used to print to e.g. serial port.
 // May get called from interrupt handlers.
-void bluescsiplatform_log(const char *s);
+void platform_log(const char *s);
 
 // Timing and delay functions.
 // Arduino platform already provides these
@@ -41,21 +41,21 @@ static inline void delay_100ns()
 }
 
 // Initialize SD card and GPIO configuration
-void bluescsiplatform_init();
+void platform_init();
 
 // Initialization for main application, not used for bootloader
-void bluescsiplatform_late_init();
+void platform_late_init();
 
 // Disable the status LED
 void platform_disable_led(void);
 
 // Setup soft watchdog if supported
-void bluescsiplatform_reset_watchdog();
+void platform_reset_watchdog();
 
 // Set callback that will be called during data transfer to/from SD card.
 // This can be used to implement simultaneous transfer to SCSI bus.
 typedef void (*sd_callback_t)(uint32_t bytes_complete);
-void bluescsiplatform_set_sd_callback(sd_callback_t func, const uint8_t *buffer);
+void platform_set_sd_callback(sd_callback_t func, const uint8_t *buffer);
 
 // Below are GPIO access definitions that are used from scsiPhy.cpp.
 // The definitions shown will work for STM32 style devices, other platforms

+ 1 - 1
lib/BlueSCSI_platform_template/README.md

@@ -50,7 +50,7 @@ To implement this, one or both of them must be able to execute transfers in back
 On most platforms this is possible for SD card access.
 The SCSI handshake mechanism is harder to implement using DMA.
 
-To implement parallelism with SD card DMA, implement `bluescsiplatform_set_sd_callback(func, buffer)`.
+To implement parallelism with SD card DMA, implement `platform_set_sd_callback(func, buffer)`.
 It sets a callback function which should be called by the SD card driver to report how many bytes have
 been transferred to/from `buffer` so far. The SD card driver should call this function in a loop while
 it is waiting for SD card transfer to finish. The code in `BlueSCSI_disk.cpp` will implement the callback

+ 7 - 7
src/BlueSCSI.cpp

@@ -403,7 +403,7 @@ static void reinitSCSI()
   }
 
 #ifdef PLATFORM_HAS_INITIATOR_MODE
-  if (bluescsiplatform_is_initiator_mode_enabled())
+  if (platform_is_initiator_mode_enabled())
   {
     // Initialize scsiDev to zero values even though it is not used
     scsiInit();
@@ -447,8 +447,8 @@ static void reinitSCSI()
 
 extern "C" void bluescsi_setup(void)
 {
-  bluescsiplatform_init();
-  bluescsiplatform_late_init();
+  platform_init();
+  platform_late_init();
 
   g_sdcard_present = mountSDCard();
 
@@ -473,7 +473,7 @@ extern "C" void bluescsi_setup(void)
     {
       blinkStatus(BLINK_ERROR_NO_SD_CARD);
       delay(1000);
-      bluescsiplatform_reset_watchdog();
+      platform_reset_watchdog();
       g_sdcard_present = mountSDCard();
     } while (!g_sdcard_present);
     bluelog("SD card init succeeded after retry");
@@ -507,10 +507,10 @@ extern "C" void bluescsi_main_loop(void)
 {
   static uint32_t sd_card_check_time = 0;
 
-  bluescsiplatform_reset_watchdog();
+  platform_reset_watchdog();
 
 #ifdef PLATFORM_HAS_INITIATOR_MODE
-  if (bluescsiplatform_is_initiator_mode_enabled())
+  if (platform_is_initiator_mode_enabled())
   {
     scsiInitiatorMainLoop();
     save_logfile();
@@ -567,7 +567,7 @@ extern "C" void bluescsi_main_loop(void)
       {
         blinkStatus(BLINK_ERROR_NO_SD_CARD);
         delay(1000);
-        bluescsiplatform_reset_watchdog();
+        platform_reset_watchdog();
       }
     } while (!g_sdcard_present && !g_romdrive_active);
   }

+ 12 - 12
src/BlueSCSI_bootloader.cpp

@@ -6,7 +6,7 @@
 #include <SdFat.h>
 #include <string.h>
 
-#ifdef BLUESCSIPLATFORM_BOOTLOADER_SIZE
+#ifdef PLATFORM_BOOTLOADER_SIZE
 
 extern SdFs SD;
 extern FsFile g_logfile;
@@ -40,20 +40,20 @@ bool find_firmware_image(FsFile &file, char name[MAX_FILE_PATH + 1])
 
 bool program_firmware(FsFile &file)
 {
-    uint32_t fwsize = file.size() - BLUESCSIPLATFORM_BOOTLOADER_SIZE;
-    uint32_t num_pages = (fwsize + BLUESCSIPLATFORM_FLASH_PAGE_SIZE - 1) / BLUESCSIPLATFORM_FLASH_PAGE_SIZE;
+    uint32_t fwsize = file.size() - PLATFORM_BOOTLOADER_SIZE;
+    uint32_t num_pages = (fwsize + PLATFORM_FLASH_PAGE_SIZE - 1) / PLATFORM_FLASH_PAGE_SIZE;
 
     // Make sure the buffer is aligned to word boundary
-    static uint32_t buffer32[BLUESCSIPLATFORM_FLASH_PAGE_SIZE / 4];
+    static uint32_t buffer32[PLATFORM_FLASH_PAGE_SIZE / 4];
     uint8_t *buffer = (uint8_t*)buffer32;
 
-    if (fwsize > BLUESCSIPLATFORM_FLASH_TOTAL_SIZE)
+    if (fwsize > PLATFORM_FLASH_TOTAL_SIZE)
     {
-        bluelog("Firmware too large: ", (int)fwsize, " flash size ", (int)BLUESCSIPLATFORM_FLASH_TOTAL_SIZE);
+        bluelog("Firmware too large: ", (int)fwsize, " flash size ", (int)PLATFORM_FLASH_TOTAL_SIZE);
         return false;
     }
 
-    if (!file.seek(BLUESCSIPLATFORM_BOOTLOADER_SIZE))
+    if (!file.seek(PLATFORM_BOOTLOADER_SIZE))
     {
         bluelog("Seek failed");
         return false;
@@ -66,13 +66,13 @@ bool program_firmware(FsFile &file)
         else
             LED_OFF();
 
-        if (file.read(buffer, BLUESCSIPLATFORM_FLASH_PAGE_SIZE) <= 0)
+        if (file.read(buffer, PLATFORM_FLASH_PAGE_SIZE) <= 0)
         {
             bluelog("Firmware file read failed on page ", i);
             return false;
         }
 
-        if (!bluescsiplatform_rewrite_flash_page(BLUESCSIPLATFORM_BOOTLOADER_SIZE + i * BLUESCSIPLATFORM_FLASH_PAGE_SIZE, buffer))
+        if (!platform_rewrite_flash_page(PLATFORM_BOOTLOADER_SIZE + i * PLATFORM_FLASH_PAGE_SIZE, buffer))
         {
             bluelog("Flash programming failed on page ", i);
             return false;
@@ -103,7 +103,7 @@ static bool mountSDCard()
 extern "C"
 int bootloader_main(void)
 {
-    bluescsiplatform_init();
+    platform_init();
     g_bluelog_debug = true;
 
     bluelog("Bootloader version: " __DATE__ " " __TIME__ " " PLATFORM_NAME);
@@ -126,7 +126,7 @@ int bootloader_main(void)
             else
             {
                 bluelog("Firmware update failed!");
-                bluescsiplatform_emergency_log_save();
+                platform_emergency_log_save();
             }
 
         }
@@ -137,7 +137,7 @@ int bootloader_main(void)
     }
 
     bluelog("Bootloader continuing to main firmware");
-    bluescsiplatform_boot_to_main_firmware();
+    platform_boot_to_main_firmware();
 
     return 0;
 }

+ 8 - 8
src/BlueSCSI_disk.cpp

@@ -767,8 +767,8 @@ bool scsiDiskOpenHDDImage(int target_idx, const char *filename, int scsi_id, int
             img.deviceType = S2S_CFG_SEQUENTIAL;
         }
 
-#ifdef BLUESCSIPLATFORM_CONFIG_HOOK
-        BLUESCSIPLATFORM_CONFIG_HOOK(&img);
+#ifdef PLATFORM_CONFIG_HOOK
+        PLATFORM_CONFIG_HOOK(&img);
 #endif
 
         setDefaultDriveInfo(target_idx);
@@ -1530,7 +1530,7 @@ void diskDataOut()
             uint8_t *buf = &scsiDev.data[start];
             g_disk_transfer.sd_transfer_start = start;
             // bluedbg("SD write ", (int)start, " + ", (int)len, " ", bytearray(buf, len));
-            bluescsiplatform_set_sd_callback(&diskDataOut_callback, buf);
+            platform_set_sd_callback(&diskDataOut_callback, buf);
             if (img.file.write(buf, len) != len)
             {
                 bluelog("SD card write failed: ", SD.sdErrorCode());
@@ -1539,7 +1539,7 @@ void diskDataOut()
                 scsiDev.target->sense.asc = WRITE_ERROR_AUTO_REALLOCATION_FAILED;
                 scsiDev.phase = STATUS;
             }
-            bluescsiplatform_set_sd_callback(NULL, NULL);
+            platform_set_sd_callback(NULL, NULL);
             g_disk_transfer.bytes_sd += len;
         }
     }
@@ -1689,7 +1689,7 @@ static void start_dataInTransfer(uint8_t *buffer, uint32_t count)
 
     // Start transferring from SD card
     image_config_t &img = *(image_config_t*)scsiDev.target->cfg;
-    bluescsiplatform_set_sd_callback(&diskDataIn_callback, buffer);
+    platform_set_sd_callback(&diskDataIn_callback, buffer);
 
     if (img.file.read(buffer, count) != count)
     {
@@ -1701,7 +1701,7 @@ static void start_dataInTransfer(uint8_t *buffer, uint32_t count)
     }
 
     diskDataIn_callback(count);
-    bluescsiplatform_set_sd_callback(NULL, NULL);
+    platform_set_sd_callback(NULL, NULL);
 }
 
 static void diskDataIn()
@@ -1767,7 +1767,7 @@ static void diskDataIn()
             // is part of a longer linear read.
             g_disk_transfer.bytes_sd = bytesPerSector;
             g_disk_transfer.bytes_scsi = bytesPerSector; // Tell callback not to send to SCSI
-            bluescsiplatform_set_sd_callback(&diskDataIn_callback, g_disk_transfer.buffer);
+            platform_set_sd_callback(&diskDataIn_callback, g_disk_transfer.buffer);
             int status = img.file.read(g_disk_transfer.buffer, bytesPerSector);
             if (status <= 0)
             {
@@ -1776,7 +1776,7 @@ static void diskDataIn()
                 break;
             }
             g_scsi_prefetch.bytes += status;
-            bluescsiplatform_set_sd_callback(NULL, NULL);
+            platform_set_sd_callback(NULL, NULL);
             prefetch_sectors--;
         }
 #endif

+ 2 - 2
src/BlueSCSI_initiator.cpp

@@ -599,7 +599,7 @@ static void scsiInitiatorWriteDataToSd(FsFile &file, bool use_callback)
 
     if (use_callback)
     {
-        bluescsiplatform_set_sd_callback(&initiatorReadSDCallback, buf);
+        platform_set_sd_callback(&initiatorReadSDCallback, buf);
     }
 
     g_initiator_transfer.bytes_sd_scheduled = g_initiator_transfer.bytes_sd + len;
@@ -608,7 +608,7 @@ static void scsiInitiatorWriteDataToSd(FsFile &file, bool use_callback)
         bluelog("scsiInitiatorReadDataToFile: SD card write failed");
         g_initiator_transfer.all_ok = false;
     }
-    bluescsiplatform_set_sd_callback(NULL, NULL);
+    platform_set_sd_callback(NULL, NULL);
     g_initiator_transfer.bytes_sd += len;
 }
 

+ 1 - 1
src/BlueSCSI_log.cpp

@@ -33,7 +33,7 @@ void bluelog_raw(const char *str)
     // Keep buffer null-terminated
     g_logbuffer[g_logpos & LOGBUFMASK] = '\0';
 
-    bluescsiplatform_log(str);
+    platform_log(str);
 }
 
 // Log byte as hex