Ver código fonte

Re-enable LED for status, disable for activity.
Support for status LED on both WiFi and non-WiFi boards.

Glenn Anderson 2 anos atrás
pai
commit
f5dce26d12

+ 9 - 5
lib/BlueSCSI_platform_RP2040/BlueSCSI_platform.cpp

@@ -159,8 +159,10 @@ void platform_init()
     gpio_conf(SDIO_D1,        GPIO_FUNC_SIO, true, false, false, true, true);
     gpio_conf(SDIO_D2,        GPIO_FUNC_SIO, true, false, false, true, true);
 
-    // LED pin
-    //gpio_conf(LED_PIN,        GPIO_FUNC_SIO, false,false, true,  false, false);
+    if (!platform_network_supported()) {
+        // LED pin
+        gpio_conf(LED_PIN,        GPIO_FUNC_SIO, false,false, true,  false, false);
+    }
 
 #ifndef ENABLE_AUDIO_OUTPUT
 #ifdef GPIO_I2C_SDA
@@ -304,9 +306,11 @@ bool platform_is_initiator_mode_enabled()
 }
 
 void platform_disable_led(void)
-{   
-    //        pin      function       pup   pdown  out    state fast
-    //gpio_conf(LED_PIN, GPIO_FUNC_SIO, false,false, false, false, false);
+{
+    if (!platform_network_supported()) {
+        //        pin      function       pup   pdown  out    state fast
+        gpio_conf(LED_PIN, GPIO_FUNC_SIO, false,false, false, false, false);
+    }
     log("Disabling status LED");
 }
 

+ 3 - 3
lib/BlueSCSI_platform_RP2040/BlueSCSI_platform_gpio.h

@@ -53,9 +53,9 @@
 #define SCSI_IN_REQ   9
 
 // Status LED pins
-//#define LED_PIN      25
-#define LED_ON()     (void)0 //cyw43_gpio_set(&cyw43_state, 0, true)  //sio_hw->gpio_set = 1 << LED_PIN
-#define LED_OFF()    (void)0 //cyw43_gpio_set(&cyw43_state, 0, false)  //sio_hw->gpio_clr = 1 << LED_PIN
+#define LED_PIN      25
+#define LED_ON()     platform_network_supported() ? cyw43_gpio_set(&cyw43_state, 0, true) : sio_hw->gpio_set = 1 << LED_PIN
+#define LED_OFF()    platform_network_supported() ? cyw43_gpio_set(&cyw43_state, 0, false) : sio_hw->gpio_clr = 1 << LED_PIN
 
 // SDIO and SPI block
 #define SD_SPI_SCK   10

+ 3 - 3
lib/SCSI2SD/src/firmware/scsi.c

@@ -74,7 +74,7 @@ void enter_BusFree()
     // Just waiting the clear delay is sufficient.
 	s2s_delay_ns(800);
 
-	s2s_ledOff();
+	//s2s_ledOff();
 	scsiDev.phase = BUS_FREE;
 	scsiDev.selFlag = 0;
 }
@@ -691,7 +691,7 @@ static uint32_t resetUntil = 0;
 static void scsiReset()
 {
 	scsiDev.rstCount++;
-	s2s_ledOff();
+	//s2s_ledOff();
 
 	scsiPhyReset();
 
@@ -811,7 +811,7 @@ static void process_SelectionPhase()
 		// (Note: the initiator will be waiting the "Selection time-out delay"
 		// for our BSY response, which is actually a very generous 250ms)
 		*SCSI_CTRL_BSY = 1;
-		s2s_ledOn();
+		//s2s_ledOn();
 
 		scsiDev.target = target;