Browse Source

Merge pull request #125 from ZuluSCSI/disable-status-led

Add the ability to disable the status LED via DisableStatusLED = 1 in zuluscsi.ini
Alex Perez 2 years ago
parent
commit
0f43d1d12c

+ 6 - 0
lib/ZuluSCSI_platform_GD32F205/ZuluSCSI_platform.cpp

@@ -239,6 +239,12 @@ void azplatform_late_init()
     greenpak_load_firmware();
     greenpak_load_firmware();
 }
 }
 
 
+void azplatform_disable_led(void)
+{   
+    gpio_init(LED_PORT, GPIO_MODE_IPU, 0, LED_PINS);
+    azlog("Disabling status LED");
+}
+
 /*****************************************/
 /*****************************************/
 /* Crash handlers                        */
 /* Crash handlers                        */
 /*****************************************/
 /*****************************************/

+ 3 - 0
lib/ZuluSCSI_platform_GD32F205/ZuluSCSI_platform.h

@@ -65,6 +65,9 @@ void azplatform_init();
 // Initialization for main application, not used for bootloader
 // Initialization for main application, not used for bootloader
 void azplatform_late_init();
 void azplatform_late_init();
 
 
+// Disable the status LED
+void azplatform_disable_led(void);
+
 // Setup soft watchdog
 // Setup soft watchdog
 void azplatform_reset_watchdog();
 void azplatform_reset_watchdog();
 
 

+ 7 - 0
lib/ZuluSCSI_platform_RP2040/ZuluSCSI_platform.cpp

@@ -231,6 +231,13 @@ bool azplatform_is_initiator_mode_enabled()
     return g_scsi_initiator;
     return g_scsi_initiator;
 }
 }
 
 
+void azplatform_disable_led(void)
+{   
+    //        pin      function       pup   pdown  out    state fast
+    gpio_conf(LED_PIN, GPIO_FUNC_SIO, false,false, false, false, false);
+    azlog("Disabling status LED");
+}
+
 /*****************************************/
 /*****************************************/
 /* Crash handlers                        */
 /* Crash handlers                        */
 /*****************************************/
 /*****************************************/

+ 3 - 0
lib/ZuluSCSI_platform_RP2040/ZuluSCSI_platform.h

@@ -54,6 +54,9 @@ void azplatform_init();
 // Initialization for main application, not used for bootloader
 // Initialization for main application, not used for bootloader
 void azplatform_late_init();
 void azplatform_late_init();
 
 
+// Disable the status LED
+void azplatform_disable_led(void);
+
 // Query whether initiator mode is enabled on targets with PLATFORM_HAS_INITIATOR_MODE
 // Query whether initiator mode is enabled on targets with PLATFORM_HAS_INITIATOR_MODE
 bool azplatform_is_initiator_mode_enabled();
 bool azplatform_is_initiator_mode_enabled();
 
 

+ 8 - 0
lib/ZuluSCSI_platform_template/ZuluSCSI_platform.cpp

@@ -27,6 +27,14 @@ void azplatform_late_init()
      */
      */
 }
 }
 
 
+void azplatform_disable_led(void)
+{
+    /* This function disables the LED on the ZuluSCSI board
+    *  Generally by switching the pin from output to input.
+    */
+}
+
+
 /*****************************************/
 /*****************************************/
 /* Debug logging and watchdor            */
 /* Debug logging and watchdor            */
 /*****************************************/
 /*****************************************/

+ 3 - 0
lib/ZuluSCSI_platform_template/ZuluSCSI_platform.h

@@ -46,6 +46,9 @@ void azplatform_init();
 // Initialization for main application, not used for bootloader
 // Initialization for main application, not used for bootloader
 void azplatform_late_init();
 void azplatform_late_init();
 
 
+// Disable the status LED
+void azplatform_disable_led(void);
+
 // Setup soft watchdog if supported
 // Setup soft watchdog if supported
 void azplatform_reset_watchdog();
 void azplatform_reset_watchdog();
 
 

+ 4 - 0
src/ZuluSCSI.cpp

@@ -519,6 +519,10 @@ extern "C" void zuluscsi_setup(void)
   if (g_sdcard_present)
   if (g_sdcard_present)
   {
   {
     init_logfile();
     init_logfile();
+    if (ini_getbool("SCSI", "DisableStatusLED", false, CONFIGFILE))
+    {
+      azplatform_disable_led();
+    }
   }
   }
 }
 }
 
 

+ 1 - 0
zuluscsi.ini

@@ -5,6 +5,7 @@ SelectionDelay = 255   # Millisecond delay after selection, 255 = automatic, 0 =
 PhyMode = 0   # 0: Best available  1: PIO  2: DMA_TIMER  3: GREENPAK_PIO   4: GREENPAK_DMA
 PhyMode = 0   # 0: Best available  1: PIO  2: DMA_TIMER  3: GREENPAK_PIO   4: GREENPAK_DMA
 #Dir = "/"   # Optionally look for image files in subdirectory
 #Dir = "/"   # Optionally look for image files in subdirectory
 #Dir2 = "/images"  # Multiple directories can be specified Dir1...Dir9
 #Dir2 = "/images"  # Multiple directories can be specified Dir1...Dir9
+#DisableStatusLED 1 # 0: Use status LED, 1: Disable status LED
 
 
 # Settings that can be needed for compatibility with some hosts
 # Settings that can be needed for compatibility with some hosts
 Quirks = 0   # 0: Standard, 1: Apple, 2: OMTI, 4: Xebec, 8: VMS
 Quirks = 0   # 0: Standard, 1: Apple, 2: OMTI, 4: Xebec, 8: VMS