From 92a00ea399003cf088e738852589147eaf6761ed Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Sat, 25 May 2024 15:21:40 +0300 Subject: [PATCH] Add PlatformIO and ARDUINO_TTGO_T_PICO_C3 support --- .gitignore | 4 ++ examples/BlynkNCP_LowLevel/ArduinoUtils.h | 2 + .../BlynkNCP_LowLevel/BlynkNCP_LowLevel.ino | 6 +- examples/BlynkNCP_LowLevel/platformio.ini | 56 +++++++++++++++++++ 4 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 examples/BlynkNCP_LowLevel/platformio.ini diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5d5f00f --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.pio/ +.DS_Store +.vscode/ + diff --git a/examples/BlynkNCP_LowLevel/ArduinoUtils.h b/examples/BlynkNCP_LowLevel/ArduinoUtils.h index 8aac862..61dcc32 100644 --- a/examples/BlynkNCP_LowLevel/ArduinoUtils.h +++ b/examples/BlynkNCP_LowLevel/ArduinoUtils.h @@ -33,6 +33,8 @@ #define SerialNCP BLYNK_NCP_SERIAL #elif defined(ARDUINO_NANO_RP2040_CONNECT) #define SerialNCP SerialNina +#elif defined(ARDUINO_TTGO_T_PICO_C3) + #define SerialNCP Serial2 #elif defined(LINUX) #include #if !defined(BLYNK_NCP_PORT) diff --git a/examples/BlynkNCP_LowLevel/BlynkNCP_LowLevel.ino b/examples/BlynkNCP_LowLevel/BlynkNCP_LowLevel.ino index d4d73c2..ee4da91 100644 --- a/examples/BlynkNCP_LowLevel/BlynkNCP_LowLevel.ino +++ b/examples/BlynkNCP_LowLevel/BlynkNCP_LowLevel.ino @@ -31,10 +31,14 @@ void setup() SerialDbg.begin(115200); waitSerialConsole(SerialDbg); - // Power-up NCP (if needed) + // Set up NCP (if needed) #if defined(ARDUINO_NANO_RP2040_CONNECT) pinMode(NINA_RESETN, OUTPUT); digitalWrite(NINA_RESETN, HIGH); +#elif defined(ARDUINO_TTGO_T_PICO_C3) + SerialNCP.setFIFOSize(2048); + SerialNCP.setTX(8); + SerialNCP.setRX(9); #endif if (!ncpSetupSerial()) { diff --git a/examples/BlynkNCP_LowLevel/platformio.ini b/examples/BlynkNCP_LowLevel/platformio.ini new file mode 100644 index 0000000..88a266f --- /dev/null +++ b/examples/BlynkNCP_LowLevel/platformio.ini @@ -0,0 +1,56 @@ +; PlatformIO Project Configuration File +; https://docs.platformio.org/page/projectconf.html + +[platformio] + +src_dir = . + +[env] +framework = arduino +monitor_speed = 115200 + +lib_deps = + BlynkNcpDriver=symlink://../../ + +build_flags = + -Wswitch -Wuninitialized + -Wunused-function + -Werror=return-type ; Fail on return type error + +[rp2040] +platform = https://github.com/maxgerhardt/platform-raspberrypi.git +board_build.core = earlephilhower +board_build.filesystem_size = 1M + +lib_ignore = + WiFi + +[rp2040:mbed] +platform = raspberrypi + +lib_ignore = + WiFi + ArduinoOTA + +######################################################## +## Dual-MCU boards +######################################################## + +[env:rp2040connect] +extends = rp2040 +board = arduino_nano_connect +board_build.filesystem_size = 8M + +[env:rp2040connect-mbed] +extends = rp2040:mbed +board = nanorp2040connect + +[env:t_pico_c3] +extends = rp2040 +board = rpipico +board_upload.maximum_size = 4194304 +board_build.filesystem_size = 2M + +build_flags = + ${env.build_flags} + -DARDUINO_TTGO_T_PICO_C3