소스 검색

fix runtime detection on Pico2 profile, though currently unused

Eric Helgeson 3 달 전
부모
커밋
f3d25e4a7a

+ 7 - 3
lib/BlueSCSI_platform_RP2MCU/BlueSCSI_platform.cpp

@@ -103,8 +103,8 @@ static void platform_write_led_picow(bool state);
 static void platform_write_led_noop(bool state) {}
 static led_write_func_t g_led_write_func = platform_write_led_noop;
 
-#if !defined(PICO_CYW43_SUPPORTED)
-extern bool __isPicoW;
+#if !defined(PICO_RP2040) && !defined(BLUESCSI_NETWORK)
+    bool __isPicoW;
 #endif
 /***************/
 /* GPIO init   */
@@ -124,7 +124,7 @@ static void gpio_conf(uint gpio, gpio_function_t fn, bool pullup, bool pulldown,
     }
 }
 
-# ifndef PICO_RP2040
+#ifndef PICO_RP2040
     /**
      * This is a workaround until arduino framework can be updated to handle all 4 variations of
      * Pico1/1w/2/2w. In testing this works on all for BlueSCSI.
@@ -132,6 +132,9 @@ static void gpio_conf(uint gpio, gpio_function_t fn, bool pullup, bool pulldown,
      */
 static void CheckPicoW() {
     extern bool __isPicoW;
+#ifndef BLUESCSI_NETWORK
+    __isPicoW = false;
+#else
     adc_init();
     auto dir = gpio_get_dir(CYW43_PIN_WL_CLOCK);
     auto fnc = gpio_get_function(CYW43_PIN_WL_CLOCK);
@@ -146,6 +149,7 @@ static void CheckPicoW() {
     } else {
         __isPicoW = false;
     }
+#endif
 }
 #endif
 

+ 2 - 0
lib/BlueSCSI_platform_RP2MCU/BlueSCSI_platform_network.cpp

@@ -365,4 +365,6 @@ void cyw43_cb_tcpip_set_link_up(cyw43_t *self, int itf)
 }
 
 }
+#else
+bool platform_network_supported() { return false; }
 #endif // BLUESCSI_NETWORK

+ 2 - 1
lib/BlueSCSI_platform_RP2MCU/BlueSCSI_platform_network.h

@@ -44,5 +44,6 @@ void platform_network_deinit();
 # ifdef __cplusplus
 }
 # endif
-
+#else
+bool platform_network_supported();
 #endif // BLUESCSI_NETWORK