Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tinyusb script for PlatformIO #450

Merged
merged 2 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
*.bak
html/*

# Clang-format Python Script
*.py

# VSCode artifacts
.vscode/*
Expand Down
1 change: 1 addition & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ lib_deps =
https://github.com/Sensirion/arduino-i2c-scd4x.git
https://github.com/Sensirion/arduino-i2c-sen5x.git
https://github.com/adafruit/WiFiNINA.git
https://github.com/Starmbi/hp_BH1750.git

; Common build environment for ESP32 platform
[common:esp32]
Expand Down
16 changes: 16 additions & 0 deletions rename_usb_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Renames tinyusb's tusb_config.h to tusb_config.h_backup for PlatformIO build environments using TinyUSB
# https://github.com/platformio/platform-espressif32/issues/809#issuecomment-1132079120
import os

Import("env")

adafruit_usb_config = os.path.join(
env.subst("$PROJECT_LIBDEPS_DIR"),
env.subst("$PIOENV"),
"Adafruit TinyUSB Library",
"src",
"tusb_config.h",
)

if os.path.isfile(adafruit_usb_config):
os.rename(adafruit_usb_config, adafruit_usb_config + "_backup")
35 changes: 35 additions & 0 deletions src/Wippersnapper_demo.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Adafruit IO WipperSnapper Beta
//
//
// NOTE: This software is a BETA release and in active development.
// Please report bugs or errors to https://github.com/adafruit/Adafruit_Wippersnapper_Arduino/issues
//
//
// Adafruit invests time and resources providing this open source code.
// Please support Adafruit and open source hardware by purchasing
// products from Adafruit!
//
// Brent Rubell for Adafruit Industries, 2021-2022
//
// All text above must be included in any redistribution.

#include "Wippersnapper_Networking.h"
Wippersnapper_WiFi wipper;

// Enable debug output for beta builds
#define WS_DEBUG

void setup() {
// Provisioning must occur prior to serial init.
wipper.provision();

Serial.begin(115200);
//while (!Serial) delay(10);

wipper.connect();

}

void loop() {
wipper.run();
}