diff --git a/.github/workflows/build-clang-doxy.yml b/.github/workflows/build-clang-doxy.yml index 4d6a46e5d..09b116d32 100644 --- a/.github/workflows/build-clang-doxy.yml +++ b/.github/workflows/build-clang-doxy.yml @@ -592,7 +592,7 @@ jobs: strategy: fail-fast: false matrix: - arduino-platform: ["picow_rp2040_tinyusb", "picow_rp2350_tinyusb"] + arduino-platform: ["picow_rp2040_tinyusb", "picow_rp2350_tinyusb", "fruit_jam_tinyusb"] steps: - name: "skip if unwanted" continue-on-error: true diff --git a/examples/Wippersnapper_demo/.fruit_jam_tinyusb.generate b/examples/Wippersnapper_demo/.fruit_jam_tinyusb.generate new file mode 100644 index 000000000..b28b04f64 --- /dev/null +++ b/examples/Wippersnapper_demo/.fruit_jam_tinyusb.generate @@ -0,0 +1,3 @@ + + + diff --git a/examples/wippersnapper_debug/.fruit_jam_tinyusb.test.skip b/examples/wippersnapper_debug/.fruit_jam_tinyusb.test.skip new file mode 100644 index 000000000..b28b04f64 --- /dev/null +++ b/examples/wippersnapper_debug/.fruit_jam_tinyusb.test.skip @@ -0,0 +1,3 @@ + + + diff --git a/platformio.ini b/platformio.ini index 3930fea8e..28f065116 100644 --- a/platformio.ini +++ b/platformio.ini @@ -89,7 +89,10 @@ lib_deps = adafruit/Adafruit SSD1306 https://github.com/tyeth/omron-devhub_d6t-arduino.git https://github.com/pstolarz/OneWireNg.git + ; COMMENT OUT FOR RP2040/RP2350 BOARDS https://github.com/milesburton/Arduino-Temperature-Control-Library.git + ; AND UNCOMMENT FOR RP2040/RP2350 BOARDS + ; https://github.com/pstolarz/Arduino-Temperature-Control-Library.git https://github.com/Sensirion/arduino-sht.git https://github.com/Sensirion/arduino-i2c-scd4x.git https://github.com/Sensirion/arduino-i2c-sen5x.git @@ -126,19 +129,15 @@ lib_compat_mode = strict lib_archive = no ; debug timer issues see https://community.platformio.org/t/choose-usb-stack-as-tiny-usb/22451/5 lib_ignore = OneWire, USBHost -[common:rp2040] +; Common build environment for Arduino-Pico platforms +[common:arduinopico] platform = https://github.com/maxgerhardt/platform-raspberrypi.git#develop -; platform_packages = -; framework-arduinopico @ symlink:///Users/tyeth/Projects/arduino-pico -; framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#master -board = rpipicow +platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git framework = arduino board_build.core = earlephilhower board_build.filesystem_size = 0.5m -build_flags = -DUSE_TINYUSB -; Once https://github.com/platformio/platformio-core > 6.1.11 these can be removed lib_ignore = WiFiNINA, WiFi101, Adafruit Zero DMA Library, OneWire -lib_compat_mode = soft ; can be strict once pio detects SleepyDog on RP2040 +lib_compat_mode = soft ; can be stricter once pio detects SleepyDog on RP2040 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Individual Board Definitions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -546,16 +545,20 @@ board_build.partitions = min_spiffs.csv [env:raspberypi_picow] -extends = common:rp2040 +extends = common:arduinopico +board = rpipicow +build_flags = + -DUSE_TINYUSB [env:raspberypi_picow_debug_port_only] -extends = common:rp2040 +extends = common:arduinopico +board = rpipicow build_flags = -DUSE_TINYUSB -DDEBUG_RP2040_PORT=Serial [env:raspberypi_picow_debug] -extends = common:rp2040 +extends = common:arduinopico ; platform = https://github.com/maxgerhardt/platform-raspberrypi.git ; platform_packages = ; framework-arduinopico @ symlink:///Users/tyeth/Projects/arduino-pico @@ -597,7 +600,7 @@ build_flags = [env:raspberypi_pico2w] -extends = common:rp2040 +extends = common:arduinopico platform = https://github.com/maxgerhardt/platform-raspberrypi.git#develop platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git @@ -610,11 +613,7 @@ build_flags = ; -DPICO_CYW43_SUPPORTED=1 [env:raspberypi_pico2w_debug] -extends = common:rp2040 -platform = https://github.com/maxgerhardt/platform-raspberrypi.git#develop -platform_packages = - framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git -; ; framework-arduinopico @ symlink:///Users/tyeth/Projects/arduino-pico +extends = common:arduinopico board = rpipico2w build_type = debug framework = arduino @@ -654,3 +653,8 @@ build_flags = ; ; No USB stack ; build_flags = -DPIO_FRAMEWORK_ARDUINO_NO_USB ; -DPIO_FRAMEWORK_ARDUINO_ENABLE_IPV6 + +[env:adafruit_fruitjam] +board = adafruit_fruitjam +lib_ignore = WiFi, WiFi101, Adafruit Zero DMA Library +build_flags = -DUSE_TINYUSB -DADAFRUIT_FRUITJAM_RP2350 \ No newline at end of file diff --git a/src/Wippersnapper_Boards.h b/src/Wippersnapper_Boards.h index 642513e2c..9a09a9ff5 100644 --- a/src/Wippersnapper_Boards.h +++ b/src/Wippersnapper_Boards.h @@ -223,6 +223,12 @@ #define USE_TINYUSB #define USE_STATUS_LED #define STATUS_LED_PIN LED_BUILTIN +#elif defined(ARDUINO_ADAFRUIT_FRUITJAM_RP2350) +#define BOARD_ID "fruitjam" +#define USE_TINYUSB +#define USE_STATUS_NEOPIXEL +#define STATUS_NEOPIXEL_PIN PIN_NEOPIXEL +#define STATUS_NEOPIXEL_NUM 5 #else #warning "Board type not identified within Wippersnapper_Boards.h!" #endif diff --git a/src/Wippersnapper_Networking.h b/src/Wippersnapper_Networking.h index cc8a65bfd..41ec1a607 100644 --- a/src/Wippersnapper_Networking.h +++ b/src/Wippersnapper_Networking.h @@ -23,7 +23,8 @@ #if defined(ADAFRUIT_METRO_M4_EXPRESS) || \ defined(ADAFRUIT_METRO_M4_AIRLIFT_LITE) || defined(ADAFRUIT_PYPORTAL) || \ - defined(ADAFRUIT_PYPORTAL_M4_TITANO) || defined(USE_AIRLIFT) + defined(ADAFRUIT_PYPORTAL_M4_TITANO) || defined(USE_AIRLIFT) || \ + defined(ADAFRUIT_FRUITJAM_RP2350) #include "network_interfaces/Wippersnapper_AIRLIFT.h" /** Nina-FW (adafruit fork) networking class */ typedef Wippersnapper_AIRLIFT Wippersnapper_WiFi; diff --git a/src/network_interfaces/Wippersnapper_AIRLIFT.h b/src/network_interfaces/Wippersnapper_AIRLIFT.h index a278d1fe1..c62eaf7ad 100644 --- a/src/network_interfaces/Wippersnapper_AIRLIFT.h +++ b/src/network_interfaces/Wippersnapper_AIRLIFT.h @@ -11,7 +11,7 @@ * please support Adafruit and open-source hardware by purchasing * products from Adafruit! * - * Copyright (c) Brent Rubell 2020-2021 for Adafruit Industries. + * Copyright (c) Brent Rubell 2020-2025 for Adafruit Industries. * * MIT license, all text here must be included in any redistribution. * @@ -32,7 +32,9 @@ #define AIRLIFT_CONNECT_TIMEOUT_MS 20000 /*!< Connection timeout (in ms) */ #define AIRLIFT_CONNECT_RETRY_DELAY_MS 200 /*!< delay time between retries. */ +#ifndef SPIWIFI #define SPIWIFI SPI /*!< Instance of SPI interface used by an AirLift. */ +#endif extern Wippersnapper WS; /****************************************************************************/ @@ -49,9 +51,13 @@ class Wippersnapper_AIRLIFT : public Wippersnapper { */ /**************************************************************************/ Wippersnapper_AIRLIFT() : Wippersnapper() { - _ssPin = SPIWIFI_SS; // 10; - _ackPin = SPIWIFI_ACK; // 7; - _rstPin = SPIWIFI_RESET; // 5; // should be 7 on PyPortals + _ssPin = SPIWIFI_SS; + _ackPin = SPIWIFI_ACK; +#ifdef ESP32_RESETN + _rstPin = ESP32_RESETN; // FruitJam +#else + _rstPin = SPIWIFI_RESET; +#endif // ESP32_RESETN #ifdef ESP32_GPIO0 _gpio0Pin = ESP32_GPIO0; #else @@ -236,7 +242,7 @@ class Wippersnapper_AIRLIFT : public Wippersnapper { */ /********************************************************/ void getMacAddr() { - uint8_t mac[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + byte mac[6] = {0}; WiFi.macAddress(mac); memcpy(WS._macAddr, mac, sizeof(mac)); } diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.cpp b/src/provisioning/tinyusb/Wippersnapper_FS.cpp index 3981c72a6..658d8df46 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.cpp +++ b/src/provisioning/tinyusb/Wippersnapper_FS.cpp @@ -28,7 +28,9 @@ defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S3_REVTFT) || \ defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2_REVTFT) || \ defined(ARDUINO_ADAFRUIT_QTPY_ESP32S3_N4R2) || \ - defined(ARDUINO_XIAO_ESP32S3) + defined(ARDUINO_XIAO_ESP32S3) || \ + defined(ADAFRUIT_FRUITJAM_RP2350) + #include "Wippersnapper_FS.h" #include "print_dependencies.h" // On-board external flash (QSPI or SPI) macros should already