Skip to content

Commit

Permalink
Merge pull request #197 from adafruit/add-qtpyesp32s2
Browse files Browse the repository at this point in the history
Add Support for Adafruit QTPY ESP32-S2
  • Loading branch information
brentru authored Dec 23, 2021
2 parents 6ddd6b2 + a0b205d commit 81f0f9c
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 16 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ jobs:
fail-fast: false
matrix:
arduino-platform: ["funhouse_tinyusb", "magtag_tinyusb",
"metro_s2_tinyusb", "feather_s2_tinyusb"]
"metro_s2_tinyusb", "feather_s2_tinyusb",
"qtpy_esp32_s2"]
steps:
- uses: actions/setup-python@v1
with:
Expand All @@ -57,6 +58,10 @@ jobs:
git clone --quiet https://github.com/brentru/Adafruit_MQTT_Library.git /home/runner/Arduino/libraries/Adafruit_MQTT_Library
- name: Build for ESP32-S2
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }}
- name: list
run : |
ls
ls examples/*/build/
- name: Rename build artifacts to reflect the platform name
run: |
mv examples/*/build/*/Wippersnapper_demo.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
Expand Down
1 change: 1 addition & 0 deletions examples/Wippersnapper_demo/.qtpy_esp32_s2.generate
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Adafruit WipperSnapper Beta
version=1.0.0-beta.16
version=1.0.0-beta.19
author=Adafruit
maintainer=Adafruit <[email protected]>
sentence=Arduino client for Adafruit.io WipperSnapper
Expand Down
2 changes: 1 addition & 1 deletion src/Wippersnapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
#endif

#define WS_VERSION \
"1.0.0-beta.18" ///< WipperSnapper app. version (semver-formatted)
"1.0.0-beta.19" ///< WipperSnapper app. version (semver-formatted)

// Reserved Adafruit IO MQTT topics
#define TOPIC_IO_THROTTLE "/throttle" ///< Adafruit IO Throttle MQTT Topic
Expand Down
7 changes: 7 additions & 0 deletions src/Wippersnapper_Boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@
#define STATUS_NEOPIXEL_PIN 33
#define STATUS_NEOPIXEL_NUM 1
#define PIN_I2C_POWER_INVERTED 7
#elif defined(ARDUINO_ADAFRUIT_QTPY_ESP32S2)
#define BOARD_ID "adafruit-qtpy-esp32s2"
#define USE_TINYUSB
#define USE_STATUS_NEOPIXEL
#define NEEDS_STATUS_NEOPIXEL_POWER
#define STATUS_NEOPIXEL_PIN PIN_NEOPIXEL
#define STATUS_NEOPIXEL_NUM 1
#elif defined(ARDUINO_ARCH_ESP8266)
#define USB_VID 0xEA60
#define USB_PID 0x10C4
Expand Down
14 changes: 4 additions & 10 deletions src/components/i2c/WipperSnapper_I2C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,10 @@ WipperSnapper_Component_I2C::scanAddresses() {
WS.feedWDT();
#endif

if (scanResp.addresses_found_count == 0) {
WS_DEBUG_PRINTLN("No I2C devices found");
scanResp.bus_response =
wippersnapper_i2c_v1_BusResponse_BUS_RESPONSE_ERROR_WIRING;
} else {
WS_DEBUG_PRINT("I2C Devices Found: ")
WS_DEBUG_PRINTLN(scanResp.addresses_found_count);
scanResp.bus_response =
wippersnapper_i2c_v1_BusResponse_BUS_RESPONSE_SUCCESS;
}
WS_DEBUG_PRINT("I2C Devices Found: ")
WS_DEBUG_PRINTLN(scanResp.addresses_found_count);

scanResp.bus_response = wippersnapper_i2c_v1_BusResponse_BUS_RESPONSE_SUCCESS;

return scanResp;
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/statusLED/Wippersnapper_StatusLED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ bool Wippersnapper::statusLEDInit() {
// some hardware requires the NEOPIXEL_POWER pin to be enabled.
#ifdef NEEDS_STATUS_NEOPIXEL_POWER
pinMode(NEOPIXEL_POWER, OUTPUT);
#if defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
#if defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2) || \
defined(ARDUINO_ADAFRUIT_QTPY_ESP32S2)
digitalWrite(NEOPIXEL_POWER, HIGH);
#else
digitalWrite(NEOPIXEL_POWER, LOW);
Expand Down
4 changes: 2 additions & 2 deletions src/provisioning/tinyusb/Wippersnapper_FS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* BSD license, all text here must be included in any redistribution.
*
*/
#if defined(ARDUINO_MAGTAG29_ESP32S2) || defined(ARDUINO_METRO_ESP32S2) || defined(ARDUINO_FUNHOUSE_ESP32S2) || defined(ADAFRUIT_METRO_M4_AIRLIFT_LITE) || defined(ADAFRUIT_PYPORTAL) || defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
#if defined(ARDUINO_MAGTAG29_ESP32S2) || defined(ARDUINO_METRO_ESP32S2) || defined(ARDUINO_FUNHOUSE_ESP32S2) || defined(ADAFRUIT_METRO_M4_AIRLIFT_LITE) || defined(ADAFRUIT_PYPORTAL) || defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2) || defined(ARDUINO_ADAFRUIT_QTPY_ESP32S2)
#include "Wippersnapper_FS.h"
// On-board external flash (QSPI or SPI) macros should already
// defined in your board variant if supported
Expand Down Expand Up @@ -277,7 +277,7 @@ void Wippersnapper_FS::createConfigFileSkel() {
secretsFile.flush();
// platform-dependent changes
#if defined(ARDUINO_MAGTAG29_ESP32S2) || defined(ARDUINO_METRO_ESP32S2) || \
defined(ARDUINO_FUNHOUSE_ESP32S2) || defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
defined(ARDUINO_FUNHOUSE_ESP32S2) || defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2) || defined (ARDUINO_ADAFRUIT_QTPY_ESP32S2)
secretsFile.print("HERE\",\n\t\"network_type_wifi_native\":{\n\t\t\"network_"
"ssid\":\"YOUR_WIFI_SSID_");
#elif defined(ADAFRUIT_PYPORTAL) || defined(ADAFRUIT_METRO_M4_AIRLIFT_LITE)
Expand Down

0 comments on commit 81f0f9c

Please sign in to comment.