From 7481d2118075f8332cd96020d1edcc682d88d4c1 Mon Sep 17 00:00:00 2001 From: Scott Bezek Date: Sun, 6 Oct 2024 10:01:16 -0700 Subject: [PATCH 1/5] Move firmware and continue removing vestiges of Arduino IDE support --- .github/workflows/pio.yml | 14 ++-- .gitignore | 2 + README.md | 2 +- arduino/splitflap/.travis.yml | 67 ------------------- {arduino/splitflap => firmware}/.gitignore | 1 - .../.vscode/extensions.json | 0 .../buildscript_build_info_macros.py | 0 .../splitflap => firmware}/esp32/.gitignore | 0 .../splitflap => firmware}/esp32/README.md | 0 .../esp32/base/base_config.h | 0 .../esp32/base/base_supervisor_task.cpp | 0 .../esp32/base/base_supervisor_task.h | 0 .../esp32/core/common.h | 0 .../esp32/core/configuration.cpp | 2 +- .../esp32/core/configuration.h | 0 .../esp32/core/logger.h | 0 .../esp32/core/recursive_semaphore_guard.h | 0 .../esp32/core/semaphore_guard.h | 0 .../esp32/core/splitflap_task.cpp | 4 +- .../esp32/core/splitflap_task.h | 2 +- .../splitflap => firmware}/esp32/core/task.h | 0 .../esp32/core/uart_stream.cpp | 0 .../esp32/core/uart_stream.h | 0 .../esp32/proto_gen/splitflap.pb.c | 0 .../esp32/proto_gen/splitflap.pb.h | 0 .../esp32/splitflap/crc32.cpp | 0 .../esp32/splitflap/crc32.h | 0 .../esp32/splitflap/debug_build_info.cpp | 0 .../esp32/splitflap/debug_build_info.h | 0 .../esp32/splitflap/display_layouts.h | 0 .../esp32/splitflap/display_task.cpp | 0 .../esp32/splitflap/display_task.h | 0 .../esp32/splitflap/http_task.cpp | 0 .../esp32/splitflap/http_task.h | 0 .../esp32/splitflap/main.cpp | 0 .../esp32/splitflap/mqtt_task.cpp | 0 .../esp32/splitflap/mqtt_task.h | 0 .../esp32/splitflap/secrets.h.example | 0 .../splitflap/serial_legacy_json_protocol.cpp | 0 .../splitflap/serial_legacy_json_protocol.h | 0 .../esp32/splitflap/serial_proto_protocol.cpp | 0 .../esp32/splitflap/serial_proto_protocol.h | 0 .../esp32/splitflap/serial_protocol.h | 0 .../esp32/splitflap/serial_task.cpp | 0 .../esp32/splitflap/serial_task.h | 0 .../esp32/tester/base64url.cpp | 0 .../esp32/tester/base64url.h | 0 .../esp32/tester/firestore.cpp | 0 .../esp32/tester/firestore.h | 0 .../esp32/tester/firestore_test_reporter.cpp | 0 .../esp32/tester/firestore_test_reporter.h | 0 .../esp32/tester/jwt.cpp | 0 .../splitflap => firmware}/esp32/tester/jwt.h | 0 .../esp32/tester/main.cpp | 0 .../esp32/tester/result.h | 0 .../esp32/tester/secrets.h.example | 0 .../esp32/tester/tester_task.cpp | 0 .../esp32/tester/tester_task.h | 0 .../splitflap => firmware}/include/README | 0 {arduino/splitflap => firmware}/lib/README | 0 .../lib/json11/CMakeLists.txt | 0 .../lib/json11/LICENSE.txt | 0 .../lib/json11/Makefile | 0 .../lib/json11/README.md | 0 .../lib/json11/json11.cpp | 0 .../lib/json11/json11.hpp | 0 .../lib/json11/json11.pc.in | 0 .../lib/json11/test.cpp | 0 .../src/Adafruit_INA219.cpp | 2 +- .../src/Adafruit_INA219.h | 0 .../Splitflap => firmware}/src/acceleration.h | 2 +- .../src/basic_io_config.h | 0 .../Splitflap => firmware/src}/config.h | 0 .../src/generate_acceleration.py | 0 .../src/spi_io_config.h | 0 .../src/splitflap_module.h | 2 +- .../src/splitflap_module_data.h | 2 +- {arduino/splitflap => firmware}/test/README | 0 .../platformio.ini => platformio.ini | 8 ++- 79 files changed, 24 insertions(+), 86 deletions(-) delete mode 100644 arduino/splitflap/.travis.yml rename {arduino/splitflap => firmware}/.gitignore (94%) rename {arduino/splitflap => firmware}/.vscode/extensions.json (100%) rename {arduino/splitflap => firmware}/buildscript_build_info_macros.py (100%) rename {arduino/splitflap => firmware}/esp32/.gitignore (100%) rename {arduino/splitflap => firmware}/esp32/README.md (100%) rename {arduino/splitflap => firmware}/esp32/base/base_config.h (100%) rename {arduino/splitflap => firmware}/esp32/base/base_supervisor_task.cpp (100%) rename {arduino/splitflap => firmware}/esp32/base/base_supervisor_task.h (100%) rename {arduino/splitflap => firmware}/esp32/core/common.h (100%) rename {arduino/splitflap => firmware}/esp32/core/configuration.cpp (99%) rename {arduino/splitflap => firmware}/esp32/core/configuration.h (100%) rename {arduino/splitflap => firmware}/esp32/core/logger.h (100%) rename {arduino/splitflap => firmware}/esp32/core/recursive_semaphore_guard.h (100%) rename {arduino/splitflap => firmware}/esp32/core/semaphore_guard.h (100%) rename {arduino/splitflap => firmware}/esp32/core/splitflap_task.cpp (99%) rename {arduino/splitflap => firmware}/esp32/core/splitflap_task.h (99%) rename {arduino/splitflap => firmware}/esp32/core/task.h (100%) rename {arduino/splitflap => firmware}/esp32/core/uart_stream.cpp (100%) rename {arduino/splitflap => firmware}/esp32/core/uart_stream.h (100%) rename {arduino/splitflap => firmware}/esp32/proto_gen/splitflap.pb.c (100%) rename {arduino/splitflap => firmware}/esp32/proto_gen/splitflap.pb.h (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/crc32.cpp (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/crc32.h (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/debug_build_info.cpp (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/debug_build_info.h (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/display_layouts.h (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/display_task.cpp (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/display_task.h (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/http_task.cpp (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/http_task.h (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/main.cpp (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/mqtt_task.cpp (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/mqtt_task.h (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/secrets.h.example (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/serial_legacy_json_protocol.cpp (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/serial_legacy_json_protocol.h (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/serial_proto_protocol.cpp (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/serial_proto_protocol.h (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/serial_protocol.h (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/serial_task.cpp (100%) rename {arduino/splitflap => firmware}/esp32/splitflap/serial_task.h (100%) rename {arduino/splitflap => firmware}/esp32/tester/base64url.cpp (100%) rename {arduino/splitflap => firmware}/esp32/tester/base64url.h (100%) rename {arduino/splitflap => firmware}/esp32/tester/firestore.cpp (100%) rename {arduino/splitflap => firmware}/esp32/tester/firestore.h (100%) rename {arduino/splitflap => firmware}/esp32/tester/firestore_test_reporter.cpp (100%) rename {arduino/splitflap => firmware}/esp32/tester/firestore_test_reporter.h (100%) rename {arduino/splitflap => firmware}/esp32/tester/jwt.cpp (100%) rename {arduino/splitflap => firmware}/esp32/tester/jwt.h (100%) rename {arduino/splitflap => firmware}/esp32/tester/main.cpp (100%) rename {arduino/splitflap => firmware}/esp32/tester/result.h (100%) rename {arduino/splitflap => firmware}/esp32/tester/secrets.h.example (100%) rename {arduino/splitflap => firmware}/esp32/tester/tester_task.cpp (100%) rename {arduino/splitflap => firmware}/esp32/tester/tester_task.h (100%) rename {arduino/splitflap => firmware}/include/README (100%) rename {arduino/splitflap => firmware}/lib/README (100%) rename {arduino/splitflap => firmware}/lib/json11/CMakeLists.txt (100%) rename {arduino/splitflap => firmware}/lib/json11/LICENSE.txt (100%) rename {arduino/splitflap => firmware}/lib/json11/Makefile (100%) rename {arduino/splitflap => firmware}/lib/json11/README.md (100%) rename {arduino/splitflap => firmware}/lib/json11/json11.cpp (100%) rename {arduino/splitflap => firmware}/lib/json11/json11.hpp (100%) rename {arduino/splitflap => firmware}/lib/json11/json11.pc.in (100%) rename {arduino/splitflap => firmware}/lib/json11/test.cpp (100%) rename {arduino/splitflap/Splitflap => firmware}/src/Adafruit_INA219.cpp (99%) rename {arduino/splitflap/Splitflap => firmware}/src/Adafruit_INA219.h (100%) rename {arduino/splitflap/Splitflap => firmware}/src/acceleration.h (94%) rename {arduino/splitflap/Splitflap => firmware}/src/basic_io_config.h (100%) rename {arduino/splitflap/Splitflap => firmware/src}/config.h (100%) rename {arduino/splitflap/Splitflap => firmware}/src/generate_acceleration.py (100%) rename {arduino/splitflap/Splitflap => firmware}/src/spi_io_config.h (100%) rename {arduino/splitflap/Splitflap => firmware}/src/splitflap_module.h (99%) rename {arduino/splitflap/Splitflap => firmware}/src/splitflap_module_data.h (97%) rename {arduino/splitflap => firmware}/test/README (100%) rename arduino/splitflap/platformio.ini => platformio.ini (96%) diff --git a/.github/workflows/pio.yml b/.github/workflows/pio.yml index c958d7da..849c3bd9 100644 --- a/.github/workflows/pio.yml +++ b/.github/workflows/pio.yml @@ -39,35 +39,35 @@ jobs: # # Run regardless of other build step failures, as long as setup steps completed # if: always() && steps.pio_install.outcome == 'success' # run: | - # pio run -d ./arduino/splitflap \ + # pio run -d ./firmware \ # -e uno-shift-register \ # - name: Build Firmware (uno-direct) # # Run regardless of other build step failures, as long as setup steps completed # if: always() && steps.pio_install.outcome == 'success' # run: | - # pio run -d ./arduino/splitflap \ + # pio run -d ./firmware \ # -e uno-direct \ - name: Build Firmware (esp32) # Run regardless of other build step failures, as long as setup steps completed if: always() && steps.pio_install.outcome == 'success' run: | - pio run -d ./arduino/splitflap \ + pio run -d ./firmware \ -e esp32 \ - name: Build Firmware (chainlink) # Run regardless of other build step failures, as long as setup steps completed if: always() && steps.pio_install.outcome == 'success' run: | - pio run -d ./arduino/splitflap \ + pio run -d ./firmware \ -e chainlink - name: Build Firmware (chainlinkBase) # Run regardless of other build step failures, as long as setup steps completed if: always() && steps.pio_install.outcome == 'success' run: | - pio run -d ./arduino/splitflap \ + pio run -d ./firmware \ -e chainlinkBase # Temporarily disabled due to proto issue @@ -75,6 +75,6 @@ jobs: # # Run regardless of other build step failures, as long as setup steps completed # if: always() && steps.pio_install.outcome == 'success' # run: | - # cp arduino/splitflap/esp32/tester/secrets.h.example arduino/splitflap/esp32/tester/secrets.h && - # pio run -d ./arduino/splitflap \ + # cp firmware/esp32/tester/secrets.h.example firmware/esp32/tester/secrets.h && + # pio run -d ./firmware \ # -e chainlinkDriverTester diff --git a/.gitignore b/.gitignore index 2dd88ede..09923e42 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ sensor.xml # Arduino compiled output *.hex + +.pio diff --git a/README.md b/README.md index bb9703fa..c28e95dd 100644 --- a/README.md +++ b/README.md @@ -469,7 +469,7 @@ an informed decision about which revision(s) to use. ## Code ### Firmware -The driver firmware is written using PlatformIO with the Arduino framework and is available at [`arduino/splitflap/Splitflap/Splitflap.ino`](arduino/splitflap/Splitflap/Splitflap.ino). +The driver firmware is written using PlatformIO with the Arduino framework and is available at [`firmware/`](firmware/). The firmware implements a closed-loop controller that accepts letters as input over USB serial and drives the stepper motors using a precomputed acceleration ramp for smooth control. The firmware automatically calibrates the spool position at startup, using the hall-effect magnetic sensor, and will automatically recalibrate itself if it ever detects that the spool position has gotten out of sync. If a commanded rotation is expected to bring the spool past the "home" position, it will confirm that the sensor is triggered neither too early nor too late; otherwise it will search for the "home" position to get in sync before continuing to the desired letter. diff --git a/arduino/splitflap/.travis.yml b/arduino/splitflap/.travis.yml deleted file mode 100644 index 7c486f18..00000000 --- a/arduino/splitflap/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < https://docs.platformio.org/page/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < https://docs.platformio.org/page/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < https://docs.platformio.org/page/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be used as a library with examples. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N diff --git a/arduino/splitflap/.gitignore b/firmware/.gitignore similarity index 94% rename from arduino/splitflap/.gitignore rename to firmware/.gitignore index 89cc49cb..587828bc 100644 --- a/arduino/splitflap/.gitignore +++ b/firmware/.gitignore @@ -1,4 +1,3 @@ -.pio .vscode/.browse.c_cpp.db* .vscode/c_cpp_properties.json .vscode/launch.json diff --git a/arduino/splitflap/.vscode/extensions.json b/firmware/.vscode/extensions.json similarity index 100% rename from arduino/splitflap/.vscode/extensions.json rename to firmware/.vscode/extensions.json diff --git a/arduino/splitflap/buildscript_build_info_macros.py b/firmware/buildscript_build_info_macros.py similarity index 100% rename from arduino/splitflap/buildscript_build_info_macros.py rename to firmware/buildscript_build_info_macros.py diff --git a/arduino/splitflap/esp32/.gitignore b/firmware/esp32/.gitignore similarity index 100% rename from arduino/splitflap/esp32/.gitignore rename to firmware/esp32/.gitignore diff --git a/arduino/splitflap/esp32/README.md b/firmware/esp32/README.md similarity index 100% rename from arduino/splitflap/esp32/README.md rename to firmware/esp32/README.md diff --git a/arduino/splitflap/esp32/base/base_config.h b/firmware/esp32/base/base_config.h similarity index 100% rename from arduino/splitflap/esp32/base/base_config.h rename to firmware/esp32/base/base_config.h diff --git a/arduino/splitflap/esp32/base/base_supervisor_task.cpp b/firmware/esp32/base/base_supervisor_task.cpp similarity index 100% rename from arduino/splitflap/esp32/base/base_supervisor_task.cpp rename to firmware/esp32/base/base_supervisor_task.cpp diff --git a/arduino/splitflap/esp32/base/base_supervisor_task.h b/firmware/esp32/base/base_supervisor_task.h similarity index 100% rename from arduino/splitflap/esp32/base/base_supervisor_task.h rename to firmware/esp32/base/base_supervisor_task.h diff --git a/arduino/splitflap/esp32/core/common.h b/firmware/esp32/core/common.h similarity index 100% rename from arduino/splitflap/esp32/core/common.h rename to firmware/esp32/core/common.h diff --git a/arduino/splitflap/esp32/core/configuration.cpp b/firmware/esp32/core/configuration.cpp similarity index 99% rename from arduino/splitflap/esp32/core/configuration.cpp rename to firmware/esp32/core/configuration.cpp index 47a5723f..1aaea912 100644 --- a/arduino/splitflap/esp32/core/configuration.cpp +++ b/firmware/esp32/core/configuration.cpp @@ -126,7 +126,7 @@ bool Configuration::saveToDisk() { } File f = FFat.open(CONFIG_PATH, FILE_WRITE); if (!f) { - log("Failed to read config file"); + log("Failed to open config file"); return false; } size_t written = f.write(buffer_, stream.bytes_written); diff --git a/arduino/splitflap/esp32/core/configuration.h b/firmware/esp32/core/configuration.h similarity index 100% rename from arduino/splitflap/esp32/core/configuration.h rename to firmware/esp32/core/configuration.h diff --git a/arduino/splitflap/esp32/core/logger.h b/firmware/esp32/core/logger.h similarity index 100% rename from arduino/splitflap/esp32/core/logger.h rename to firmware/esp32/core/logger.h diff --git a/arduino/splitflap/esp32/core/recursive_semaphore_guard.h b/firmware/esp32/core/recursive_semaphore_guard.h similarity index 100% rename from arduino/splitflap/esp32/core/recursive_semaphore_guard.h rename to firmware/esp32/core/recursive_semaphore_guard.h diff --git a/arduino/splitflap/esp32/core/semaphore_guard.h b/firmware/esp32/core/semaphore_guard.h similarity index 100% rename from arduino/splitflap/esp32/core/semaphore_guard.h rename to firmware/esp32/core/semaphore_guard.h diff --git a/arduino/splitflap/esp32/core/splitflap_task.cpp b/firmware/esp32/core/splitflap_task.cpp similarity index 99% rename from arduino/splitflap/esp32/core/splitflap_task.cpp rename to firmware/esp32/core/splitflap_task.cpp index e9b39534..b6c86146 100644 --- a/arduino/splitflap/esp32/core/splitflap_task.cpp +++ b/firmware/esp32/core/splitflap_task.cpp @@ -18,8 +18,8 @@ // General splitflap includes #include "config.h" -#include "src/splitflap_module.h" -#include "src/spi_io_config.h" +#include "splitflap_module.h" +#include "spi_io_config.h" // ESP32-specific includes #include "semaphore_guard.h" diff --git a/arduino/splitflap/esp32/core/splitflap_task.h b/firmware/esp32/core/splitflap_task.h similarity index 99% rename from arduino/splitflap/esp32/core/splitflap_task.h rename to firmware/esp32/core/splitflap_task.h index 54adafef..2eb48dff 100644 --- a/arduino/splitflap/esp32/core/splitflap_task.h +++ b/firmware/esp32/core/splitflap_task.h @@ -17,7 +17,7 @@ #include "config.h" #include "logger.h" -#include "src/splitflap_module_data.h" +#include "splitflap_module_data.h" #include "configuration.h" #include "task.h" diff --git a/arduino/splitflap/esp32/core/task.h b/firmware/esp32/core/task.h similarity index 100% rename from arduino/splitflap/esp32/core/task.h rename to firmware/esp32/core/task.h diff --git a/arduino/splitflap/esp32/core/uart_stream.cpp b/firmware/esp32/core/uart_stream.cpp similarity index 100% rename from arduino/splitflap/esp32/core/uart_stream.cpp rename to firmware/esp32/core/uart_stream.cpp diff --git a/arduino/splitflap/esp32/core/uart_stream.h b/firmware/esp32/core/uart_stream.h similarity index 100% rename from arduino/splitflap/esp32/core/uart_stream.h rename to firmware/esp32/core/uart_stream.h diff --git a/arduino/splitflap/esp32/proto_gen/splitflap.pb.c b/firmware/esp32/proto_gen/splitflap.pb.c similarity index 100% rename from arduino/splitflap/esp32/proto_gen/splitflap.pb.c rename to firmware/esp32/proto_gen/splitflap.pb.c diff --git a/arduino/splitflap/esp32/proto_gen/splitflap.pb.h b/firmware/esp32/proto_gen/splitflap.pb.h similarity index 100% rename from arduino/splitflap/esp32/proto_gen/splitflap.pb.h rename to firmware/esp32/proto_gen/splitflap.pb.h diff --git a/arduino/splitflap/esp32/splitflap/crc32.cpp b/firmware/esp32/splitflap/crc32.cpp similarity index 100% rename from arduino/splitflap/esp32/splitflap/crc32.cpp rename to firmware/esp32/splitflap/crc32.cpp diff --git a/arduino/splitflap/esp32/splitflap/crc32.h b/firmware/esp32/splitflap/crc32.h similarity index 100% rename from arduino/splitflap/esp32/splitflap/crc32.h rename to firmware/esp32/splitflap/crc32.h diff --git a/arduino/splitflap/esp32/splitflap/debug_build_info.cpp b/firmware/esp32/splitflap/debug_build_info.cpp similarity index 100% rename from arduino/splitflap/esp32/splitflap/debug_build_info.cpp rename to firmware/esp32/splitflap/debug_build_info.cpp diff --git a/arduino/splitflap/esp32/splitflap/debug_build_info.h b/firmware/esp32/splitflap/debug_build_info.h similarity index 100% rename from arduino/splitflap/esp32/splitflap/debug_build_info.h rename to firmware/esp32/splitflap/debug_build_info.h diff --git a/arduino/splitflap/esp32/splitflap/display_layouts.h b/firmware/esp32/splitflap/display_layouts.h similarity index 100% rename from arduino/splitflap/esp32/splitflap/display_layouts.h rename to firmware/esp32/splitflap/display_layouts.h diff --git a/arduino/splitflap/esp32/splitflap/display_task.cpp b/firmware/esp32/splitflap/display_task.cpp similarity index 100% rename from arduino/splitflap/esp32/splitflap/display_task.cpp rename to firmware/esp32/splitflap/display_task.cpp diff --git a/arduino/splitflap/esp32/splitflap/display_task.h b/firmware/esp32/splitflap/display_task.h similarity index 100% rename from arduino/splitflap/esp32/splitflap/display_task.h rename to firmware/esp32/splitflap/display_task.h diff --git a/arduino/splitflap/esp32/splitflap/http_task.cpp b/firmware/esp32/splitflap/http_task.cpp similarity index 100% rename from arduino/splitflap/esp32/splitflap/http_task.cpp rename to firmware/esp32/splitflap/http_task.cpp diff --git a/arduino/splitflap/esp32/splitflap/http_task.h b/firmware/esp32/splitflap/http_task.h similarity index 100% rename from arduino/splitflap/esp32/splitflap/http_task.h rename to firmware/esp32/splitflap/http_task.h diff --git a/arduino/splitflap/esp32/splitflap/main.cpp b/firmware/esp32/splitflap/main.cpp similarity index 100% rename from arduino/splitflap/esp32/splitflap/main.cpp rename to firmware/esp32/splitflap/main.cpp diff --git a/arduino/splitflap/esp32/splitflap/mqtt_task.cpp b/firmware/esp32/splitflap/mqtt_task.cpp similarity index 100% rename from arduino/splitflap/esp32/splitflap/mqtt_task.cpp rename to firmware/esp32/splitflap/mqtt_task.cpp diff --git a/arduino/splitflap/esp32/splitflap/mqtt_task.h b/firmware/esp32/splitflap/mqtt_task.h similarity index 100% rename from arduino/splitflap/esp32/splitflap/mqtt_task.h rename to firmware/esp32/splitflap/mqtt_task.h diff --git a/arduino/splitflap/esp32/splitflap/secrets.h.example b/firmware/esp32/splitflap/secrets.h.example similarity index 100% rename from arduino/splitflap/esp32/splitflap/secrets.h.example rename to firmware/esp32/splitflap/secrets.h.example diff --git a/arduino/splitflap/esp32/splitflap/serial_legacy_json_protocol.cpp b/firmware/esp32/splitflap/serial_legacy_json_protocol.cpp similarity index 100% rename from arduino/splitflap/esp32/splitflap/serial_legacy_json_protocol.cpp rename to firmware/esp32/splitflap/serial_legacy_json_protocol.cpp diff --git a/arduino/splitflap/esp32/splitflap/serial_legacy_json_protocol.h b/firmware/esp32/splitflap/serial_legacy_json_protocol.h similarity index 100% rename from arduino/splitflap/esp32/splitflap/serial_legacy_json_protocol.h rename to firmware/esp32/splitflap/serial_legacy_json_protocol.h diff --git a/arduino/splitflap/esp32/splitflap/serial_proto_protocol.cpp b/firmware/esp32/splitflap/serial_proto_protocol.cpp similarity index 100% rename from arduino/splitflap/esp32/splitflap/serial_proto_protocol.cpp rename to firmware/esp32/splitflap/serial_proto_protocol.cpp diff --git a/arduino/splitflap/esp32/splitflap/serial_proto_protocol.h b/firmware/esp32/splitflap/serial_proto_protocol.h similarity index 100% rename from arduino/splitflap/esp32/splitflap/serial_proto_protocol.h rename to firmware/esp32/splitflap/serial_proto_protocol.h diff --git a/arduino/splitflap/esp32/splitflap/serial_protocol.h b/firmware/esp32/splitflap/serial_protocol.h similarity index 100% rename from arduino/splitflap/esp32/splitflap/serial_protocol.h rename to firmware/esp32/splitflap/serial_protocol.h diff --git a/arduino/splitflap/esp32/splitflap/serial_task.cpp b/firmware/esp32/splitflap/serial_task.cpp similarity index 100% rename from arduino/splitflap/esp32/splitflap/serial_task.cpp rename to firmware/esp32/splitflap/serial_task.cpp diff --git a/arduino/splitflap/esp32/splitflap/serial_task.h b/firmware/esp32/splitflap/serial_task.h similarity index 100% rename from arduino/splitflap/esp32/splitflap/serial_task.h rename to firmware/esp32/splitflap/serial_task.h diff --git a/arduino/splitflap/esp32/tester/base64url.cpp b/firmware/esp32/tester/base64url.cpp similarity index 100% rename from arduino/splitflap/esp32/tester/base64url.cpp rename to firmware/esp32/tester/base64url.cpp diff --git a/arduino/splitflap/esp32/tester/base64url.h b/firmware/esp32/tester/base64url.h similarity index 100% rename from arduino/splitflap/esp32/tester/base64url.h rename to firmware/esp32/tester/base64url.h diff --git a/arduino/splitflap/esp32/tester/firestore.cpp b/firmware/esp32/tester/firestore.cpp similarity index 100% rename from arduino/splitflap/esp32/tester/firestore.cpp rename to firmware/esp32/tester/firestore.cpp diff --git a/arduino/splitflap/esp32/tester/firestore.h b/firmware/esp32/tester/firestore.h similarity index 100% rename from arduino/splitflap/esp32/tester/firestore.h rename to firmware/esp32/tester/firestore.h diff --git a/arduino/splitflap/esp32/tester/firestore_test_reporter.cpp b/firmware/esp32/tester/firestore_test_reporter.cpp similarity index 100% rename from arduino/splitflap/esp32/tester/firestore_test_reporter.cpp rename to firmware/esp32/tester/firestore_test_reporter.cpp diff --git a/arduino/splitflap/esp32/tester/firestore_test_reporter.h b/firmware/esp32/tester/firestore_test_reporter.h similarity index 100% rename from arduino/splitflap/esp32/tester/firestore_test_reporter.h rename to firmware/esp32/tester/firestore_test_reporter.h diff --git a/arduino/splitflap/esp32/tester/jwt.cpp b/firmware/esp32/tester/jwt.cpp similarity index 100% rename from arduino/splitflap/esp32/tester/jwt.cpp rename to firmware/esp32/tester/jwt.cpp diff --git a/arduino/splitflap/esp32/tester/jwt.h b/firmware/esp32/tester/jwt.h similarity index 100% rename from arduino/splitflap/esp32/tester/jwt.h rename to firmware/esp32/tester/jwt.h diff --git a/arduino/splitflap/esp32/tester/main.cpp b/firmware/esp32/tester/main.cpp similarity index 100% rename from arduino/splitflap/esp32/tester/main.cpp rename to firmware/esp32/tester/main.cpp diff --git a/arduino/splitflap/esp32/tester/result.h b/firmware/esp32/tester/result.h similarity index 100% rename from arduino/splitflap/esp32/tester/result.h rename to firmware/esp32/tester/result.h diff --git a/arduino/splitflap/esp32/tester/secrets.h.example b/firmware/esp32/tester/secrets.h.example similarity index 100% rename from arduino/splitflap/esp32/tester/secrets.h.example rename to firmware/esp32/tester/secrets.h.example diff --git a/arduino/splitflap/esp32/tester/tester_task.cpp b/firmware/esp32/tester/tester_task.cpp similarity index 100% rename from arduino/splitflap/esp32/tester/tester_task.cpp rename to firmware/esp32/tester/tester_task.cpp diff --git a/arduino/splitflap/esp32/tester/tester_task.h b/firmware/esp32/tester/tester_task.h similarity index 100% rename from arduino/splitflap/esp32/tester/tester_task.h rename to firmware/esp32/tester/tester_task.h diff --git a/arduino/splitflap/include/README b/firmware/include/README similarity index 100% rename from arduino/splitflap/include/README rename to firmware/include/README diff --git a/arduino/splitflap/lib/README b/firmware/lib/README similarity index 100% rename from arduino/splitflap/lib/README rename to firmware/lib/README diff --git a/arduino/splitflap/lib/json11/CMakeLists.txt b/firmware/lib/json11/CMakeLists.txt similarity index 100% rename from arduino/splitflap/lib/json11/CMakeLists.txt rename to firmware/lib/json11/CMakeLists.txt diff --git a/arduino/splitflap/lib/json11/LICENSE.txt b/firmware/lib/json11/LICENSE.txt similarity index 100% rename from arduino/splitflap/lib/json11/LICENSE.txt rename to firmware/lib/json11/LICENSE.txt diff --git a/arduino/splitflap/lib/json11/Makefile b/firmware/lib/json11/Makefile similarity index 100% rename from arduino/splitflap/lib/json11/Makefile rename to firmware/lib/json11/Makefile diff --git a/arduino/splitflap/lib/json11/README.md b/firmware/lib/json11/README.md similarity index 100% rename from arduino/splitflap/lib/json11/README.md rename to firmware/lib/json11/README.md diff --git a/arduino/splitflap/lib/json11/json11.cpp b/firmware/lib/json11/json11.cpp similarity index 100% rename from arduino/splitflap/lib/json11/json11.cpp rename to firmware/lib/json11/json11.cpp diff --git a/arduino/splitflap/lib/json11/json11.hpp b/firmware/lib/json11/json11.hpp similarity index 100% rename from arduino/splitflap/lib/json11/json11.hpp rename to firmware/lib/json11/json11.hpp diff --git a/arduino/splitflap/lib/json11/json11.pc.in b/firmware/lib/json11/json11.pc.in similarity index 100% rename from arduino/splitflap/lib/json11/json11.pc.in rename to firmware/lib/json11/json11.pc.in diff --git a/arduino/splitflap/lib/json11/test.cpp b/firmware/lib/json11/test.cpp similarity index 100% rename from arduino/splitflap/lib/json11/test.cpp rename to firmware/lib/json11/test.cpp diff --git a/arduino/splitflap/Splitflap/src/Adafruit_INA219.cpp b/firmware/src/Adafruit_INA219.cpp similarity index 99% rename from arduino/splitflap/Splitflap/src/Adafruit_INA219.cpp rename to firmware/src/Adafruit_INA219.cpp index 4a602096..0c56108a 100644 --- a/arduino/splitflap/Splitflap/src/Adafruit_INA219.cpp +++ b/firmware/src/Adafruit_INA219.cpp @@ -24,7 +24,7 @@ * */ -#include "../config.h" +#include "config.h" #if INA219_POWER_SENSE #include "Arduino.h" diff --git a/arduino/splitflap/Splitflap/src/Adafruit_INA219.h b/firmware/src/Adafruit_INA219.h similarity index 100% rename from arduino/splitflap/Splitflap/src/Adafruit_INA219.h rename to firmware/src/Adafruit_INA219.h diff --git a/arduino/splitflap/Splitflap/src/acceleration.h b/firmware/src/acceleration.h similarity index 94% rename from arduino/splitflap/Splitflap/src/acceleration.h rename to firmware/src/acceleration.h index 2da62eae..d7342b4c 100644 --- a/arduino/splitflap/Splitflap/src/acceleration.h +++ b/firmware/src/acceleration.h @@ -15,7 +15,7 @@ */ // NOTE: THIS FILE IS AUTOGENERATED! DO NOT MODIFY! -// To update, run `arduino/splitflap/Splitflap/src/generate_acceleration.py` +// To update, run `firmware/src/generate_acceleration.py` #ifndef ACCELERATION #define ACCELERATION diff --git a/arduino/splitflap/Splitflap/src/basic_io_config.h b/firmware/src/basic_io_config.h similarity index 100% rename from arduino/splitflap/Splitflap/src/basic_io_config.h rename to firmware/src/basic_io_config.h diff --git a/arduino/splitflap/Splitflap/config.h b/firmware/src/config.h similarity index 100% rename from arduino/splitflap/Splitflap/config.h rename to firmware/src/config.h diff --git a/arduino/splitflap/Splitflap/src/generate_acceleration.py b/firmware/src/generate_acceleration.py similarity index 100% rename from arduino/splitflap/Splitflap/src/generate_acceleration.py rename to firmware/src/generate_acceleration.py diff --git a/arduino/splitflap/Splitflap/src/spi_io_config.h b/firmware/src/spi_io_config.h similarity index 100% rename from arduino/splitflap/Splitflap/src/spi_io_config.h rename to firmware/src/spi_io_config.h diff --git a/arduino/splitflap/Splitflap/src/splitflap_module.h b/firmware/src/splitflap_module.h similarity index 99% rename from arduino/splitflap/Splitflap/src/splitflap_module.h rename to firmware/src/splitflap_module.h index ba8dea7a..cd6dca94 100644 --- a/arduino/splitflap/Splitflap/src/splitflap_module.h +++ b/firmware/src/splitflap_module.h @@ -21,7 +21,7 @@ #include "acceleration.h" #include "splitflap_module_data.h" -#include "../config.h" +#include "config.h" // Logging and assertions are useful for debugging, but likely add too much time/space overhead to be used when // driving many SplitflapModules at once. diff --git a/arduino/splitflap/Splitflap/src/splitflap_module_data.h b/firmware/src/splitflap_module_data.h similarity index 97% rename from arduino/splitflap/Splitflap/src/splitflap_module_data.h rename to firmware/src/splitflap_module_data.h index 29258b61..6e776700 100644 --- a/arduino/splitflap/Splitflap/src/splitflap_module_data.h +++ b/firmware/src/splitflap_module_data.h @@ -15,7 +15,7 @@ */ #pragma once -#include "../config.h" +#include "config.h" #if HOME_CALIBRATION_ENABLED enum HomeState { diff --git a/arduino/splitflap/test/README b/firmware/test/README similarity index 100% rename from arduino/splitflap/test/README rename to firmware/test/README diff --git a/arduino/splitflap/platformio.ini b/platformio.ini similarity index 96% rename from arduino/splitflap/platformio.ini rename to platformio.ini index cdc97150..8e5a3642 100644 --- a/arduino/splitflap/platformio.ini +++ b/platformio.ini @@ -9,7 +9,11 @@ ; https://docs.platformio.org/page/projectconf.html [platformio] -src_dir = Splitflap +src_dir = firmware/src +lib_dir = firmware/lib +include_dir = firmware/include +test_dir = firmware/test +data_dir = firmware/data ; Note: change this to the target environment to get VSCode to handle code ; completion, etc, correctly. @@ -65,7 +69,7 @@ monitor_filters = esp32_exception_decoder board_build.partitions = default_ffat.csv extra_scripts = - pre:buildscript_build_info_macros.py + pre:firmware/buildscript_build_info_macros.py ; This would be much cleaner if we didn't need to preserve Arduino IDE compatibility and the splitflap ; module driver could be pulled out to its own library and shared properly... Instead, we remove the From 419c311fb3f105bfcdb112e7a98b1ed1645333f3 Mon Sep 17 00:00:00 2001 From: Scott Bezek Date: Sun, 6 Oct 2024 10:04:16 -0700 Subject: [PATCH 2/5] Fix pio commands in CI --- .github/workflows/pio.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pio.yml b/.github/workflows/pio.yml index 849c3bd9..238b6f7d 100644 --- a/.github/workflows/pio.yml +++ b/.github/workflows/pio.yml @@ -39,35 +39,35 @@ jobs: # # Run regardless of other build step failures, as long as setup steps completed # if: always() && steps.pio_install.outcome == 'success' # run: | - # pio run -d ./firmware \ + # pio run \ # -e uno-shift-register \ # - name: Build Firmware (uno-direct) # # Run regardless of other build step failures, as long as setup steps completed # if: always() && steps.pio_install.outcome == 'success' # run: | - # pio run -d ./firmware \ + # pio run \ # -e uno-direct \ - name: Build Firmware (esp32) # Run regardless of other build step failures, as long as setup steps completed if: always() && steps.pio_install.outcome == 'success' run: | - pio run -d ./firmware \ + pio run \ -e esp32 \ - name: Build Firmware (chainlink) # Run regardless of other build step failures, as long as setup steps completed if: always() && steps.pio_install.outcome == 'success' run: | - pio run -d ./firmware \ + pio run \ -e chainlink - name: Build Firmware (chainlinkBase) # Run regardless of other build step failures, as long as setup steps completed if: always() && steps.pio_install.outcome == 'success' run: | - pio run -d ./firmware \ + pio run \ -e chainlinkBase # Temporarily disabled due to proto issue @@ -76,5 +76,5 @@ jobs: # if: always() && steps.pio_install.outcome == 'success' # run: | # cp firmware/esp32/tester/secrets.h.example firmware/esp32/tester/secrets.h && - # pio run -d ./firmware \ + # pio run \ # -e chainlinkDriverTester From f6aa516fef2908ffcc206a41febb4852e8988751 Mon Sep 17 00:00:00 2001 From: Scott Bezek Date: Sun, 6 Oct 2024 11:57:51 -0700 Subject: [PATCH 3/5] Fix build, rename esp32->esp32CustomAdvanced --- .github/workflows/pio.yml | 4 ++-- firmware/esp32/base/base_supervisor_task.h | 2 +- firmware/esp32/tester/tester_task.h | 2 +- firmware/src/Adafruit_INA219.h | 2 +- platformio.ini | 12 ++++++------ 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pio.yml b/.github/workflows/pio.yml index 238b6f7d..bb8819ec 100644 --- a/.github/workflows/pio.yml +++ b/.github/workflows/pio.yml @@ -49,12 +49,12 @@ jobs: # pio run \ # -e uno-direct \ - - name: Build Firmware (esp32) + - name: Build Firmware (esp32CustomAdvanced) # Run regardless of other build step failures, as long as setup steps completed if: always() && steps.pio_install.outcome == 'success' run: | pio run \ - -e esp32 \ + -e esp32CustomAdvanced - name: Build Firmware (chainlink) # Run regardless of other build step failures, as long as setup steps completed diff --git a/firmware/esp32/base/base_supervisor_task.h b/firmware/esp32/base/base_supervisor_task.h index 39da7528..168b1c92 100644 --- a/firmware/esp32/base/base_supervisor_task.h +++ b/firmware/esp32/base/base_supervisor_task.h @@ -19,7 +19,7 @@ #include #include "Adafruit_MCP23017.h" -#include "src/Adafruit_INA219.h" +#include "Adafruit_INA219.h" #include "../splitflap/serial_task.h" #include "../core/splitflap_task.h" diff --git a/firmware/esp32/tester/tester_task.h b/firmware/esp32/tester/tester_task.h index b7a03f06..425ebbd1 100644 --- a/firmware/esp32/tester/tester_task.h +++ b/firmware/esp32/tester/tester_task.h @@ -20,7 +20,7 @@ #include #include "Adafruit_MCP23017.h" -#include "src/Adafruit_INA219.h" +#include "Adafruit_INA219.h" #include "result.h" #include "../core/splitflap_task.h" diff --git a/firmware/src/Adafruit_INA219.h b/firmware/src/Adafruit_INA219.h index a84786f8..e46de474 100644 --- a/firmware/src/Adafruit_INA219.h +++ b/firmware/src/Adafruit_INA219.h @@ -16,7 +16,7 @@ * BSD license, all text here must be included in any redistribution. * */ -#include "../config.h" +#include "config.h" #if INA219_POWER_SENSE #ifndef _LIB_ADAFRUIT_INA219_ #define _LIB_ADAFRUIT_INA219_ diff --git a/platformio.ini b/platformio.ini index 8e5a3642..4a705929 100644 --- a/platformio.ini +++ b/platformio.ini @@ -115,12 +115,6 @@ build_flags = -DLOAD_GFXFF=1 -DSPI_FREQUENCY=40000000 -[env:esp32] -extends=esp32base -build_flags = - ${esp32base.build_flags} - -DNUM_MODULES=6 - [env:chainlink] extends=esp32base build_flags = @@ -157,3 +151,9 @@ lib_deps = adafruit/Adafruit MCP23017 Arduino Library @ ^1.3.0 adafruit/Adafruit BusIO @ ^1.9.1 build_type = debug + +[env:esp32CustomAdvanced] +extends=esp32base +build_flags = + ${esp32base.build_flags} + -DNUM_MODULES=6 \ No newline at end of file From 5a80abdef9624320170fbc39b386b8cec6c7316b Mon Sep 17 00:00:00 2001 From: Scott Bezek Date: Sun, 6 Oct 2024 12:05:54 -0700 Subject: [PATCH 4/5] Add scary warnings about the esp32CustomAdvanced env --- platformio.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platformio.ini b/platformio.ini index 4a705929..ecd31a47 100644 --- a/platformio.ini +++ b/platformio.ini @@ -153,6 +153,8 @@ lib_deps = build_type = debug [env:esp32CustomAdvanced] +; For non-chainlink custom ESP32-based advanced builds that use shift registers but omit the Chainlink design elements like loopbacks and LEDs. +; This is not the environment you want unless you have custom non-Chainlink hardware and really know the intricacies of the shift register arrangement. extends=esp32base build_flags = ${esp32base.build_flags} From f289aece35ebf22fd1e89626c9e94cc27ba163fe Mon Sep 17 00:00:00 2001 From: Scott Bezek Date: Sun, 6 Oct 2024 12:47:47 -0700 Subject: [PATCH 5/5] Add a tombstone to arduino/splitflap --- arduino/splitflap/MOVED.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 arduino/splitflap/MOVED.txt diff --git a/arduino/splitflap/MOVED.txt b/arduino/splitflap/MOVED.txt new file mode 100644 index 00000000..0690a262 --- /dev/null +++ b/arduino/splitflap/MOVED.txt @@ -0,0 +1,4 @@ +As of 2024-10-06, the firmware code that used to live in this directory has been moved to the "firmware" directory at the root of the repo. + +In VS Code, you'll want to re-open this project by using "Open Folder" and selecting the entire "splitflap" repository folder. +If you run into any issues, please reach out in the discord community (https://discord.com/invite/wgehm3PcrC) for help.