Sfoglia il codice sorgente

GD32F205: Fix build errors

There is circular dependency as GD32F205 platform includes
ZuluSCSI_disk.h for the prefetchbytes workaround. This
requires `lib_ldf_mode = chain+` for platformio.

In addition the GD32F205 with audio buffers is very low on RAM.
Moved some constants into flash so that the new multi-bin/cue support
fits.
Petteri Aimonen 1 anno fa
parent
commit
0a828e79a3

+ 1 - 1
lib/ZuluSCSI_platform_GD32F205/gd32_cdc_acm_core.c

@@ -233,7 +233,7 @@ static const usb_desc_str product_string =
 };
 
 /* USBD serial string */
-static usb_desc_str serial_string = 
+static const usb_desc_str serial_string =
 {
     .header = 
      {

+ 1 - 1
lib/ZuluSCSI_platform_GD32F205/scsi_accel_dma.cpp

@@ -704,4 +704,4 @@ static void greenpak_stop_dma()
     exti_interrupt_disable(GREENPAK_PLD_IO2_EXTI);
 }
 
-#endif
+#endif

+ 1 - 1
lib/ZuluSCSI_platform_GD32F205/usbd_msc_core.c

@@ -167,7 +167,7 @@ static __ALIGN_BEGIN const usb_desc_str product_string __ALIGN_END = {
 };
 
 /* USBD serial string */
-static __ALIGN_BEGIN usb_desc_str serial_string __ALIGN_END = {
+static __ALIGN_BEGIN const usb_desc_str serial_string __ALIGN_END = {
     .header =
     {
         .bLength         = USB_STRING_LEN(12U),

+ 1 - 0
platformio.ini

@@ -33,6 +33,7 @@ board_build.ldscript = lib/ZuluSCSI_platform_GD32F205/zuluscsi_gd32f205.ld
 ldscript_bootloader = lib/ZuluSCSI_platform_GD32F205/zuluscsi_gd32f205_btldr.ld
 framework = spl
 lib_compat_mode = off
+lib_ldf_mode = chain+
 lib_deps =
     SdFat=https://github.com/rabbitholecomputing/SdFat#2.2.3-gpt
     minIni

+ 19 - 19
src/ZuluSCSI_settings.cpp

@@ -104,25 +104,25 @@ void ZuluSCSISettings::setDefaultDriveInfo(uint8_t scsiId, const char *presetNam
     
 
 
-    static const char *driveinfo_fixed[4]     = DRIVEINFO_FIXED;
-    static const char *driveinfo_removable[4] = DRIVEINFO_REMOVABLE;
-    static const char *driveinfo_optical[4]   = DRIVEINFO_OPTICAL;
-    static const char *driveinfo_floppy[4]    = DRIVEINFO_FLOPPY;
-    static const char *driveinfo_magopt[4]    = DRIVEINFO_MAGOPT;
-    static const char *driveinfo_network[4]   = DRIVEINFO_NETWORK;
-    static const char *driveinfo_tape[4]      = DRIVEINFO_TAPE;
-
-    static const char *apl_driveinfo_fixed[4]     = APPLE_DRIVEINFO_FIXED;
-    static const char *apl_driveinfo_removable[4] = APPLE_DRIVEINFO_REMOVABLE;
-    static const char *apl_driveinfo_optical[4]   = APPLE_DRIVEINFO_OPTICAL;
-    static const char *apl_driveinfo_floppy[4]    = APPLE_DRIVEINFO_FLOPPY;
-    static const char *apl_driveinfo_magopt[4]    = APPLE_DRIVEINFO_MAGOPT;
-    static const char *apl_driveinfo_network[4]   = APPLE_DRIVEINFO_NETWORK;
-    static const char *apl_driveinfo_tape[4]      = APPLE_DRIVEINFO_TAPE;
-
-    static const char *iomega_driveinfo_removeable[4] = IOMEGA_DRIVEINFO_ZIP100;
+    static const char * const driveinfo_fixed[4]     = DRIVEINFO_FIXED;
+    static const char * const driveinfo_removable[4] = DRIVEINFO_REMOVABLE;
+    static const char * const driveinfo_optical[4]   = DRIVEINFO_OPTICAL;
+    static const char * const driveinfo_floppy[4]    = DRIVEINFO_FLOPPY;
+    static const char * const driveinfo_magopt[4]    = DRIVEINFO_MAGOPT;
+    static const char * const driveinfo_network[4]   = DRIVEINFO_NETWORK;
+    static const char * const driveinfo_tape[4]      = DRIVEINFO_TAPE;
+
+    static const char * const apl_driveinfo_fixed[4]     = APPLE_DRIVEINFO_FIXED;
+    static const char * const apl_driveinfo_removable[4] = APPLE_DRIVEINFO_REMOVABLE;
+    static const char * const apl_driveinfo_optical[4]   = APPLE_DRIVEINFO_OPTICAL;
+    static const char * const apl_driveinfo_floppy[4]    = APPLE_DRIVEINFO_FLOPPY;
+    static const char * const apl_driveinfo_magopt[4]    = APPLE_DRIVEINFO_MAGOPT;
+    static const char * const apl_driveinfo_network[4]   = APPLE_DRIVEINFO_NETWORK;
+    static const char * const apl_driveinfo_tape[4]      = APPLE_DRIVEINFO_TAPE;
+
+    static const char * const iomega_driveinfo_removeable[4] = IOMEGA_DRIVEINFO_ZIP100;
     
-    const char **driveinfo = NULL;
+    const char * const * driveinfo = NULL;
     bool known_preset = false;
     scsi_system_settings_t& cfgSys = m_sys;
 
@@ -483,4 +483,4 @@ scsi_device_preset_t ZuluSCSISettings::getDevicePreset(uint8_t scsiId)
 const char* ZuluSCSISettings::getDevicePresetName(uint8_t scsiId)
 {
     return devicePresetName[m_devPreset[scsiId]];
-}
+}