diff --git a/.github/workflows/pio.yml b/.github/workflows/pio.yml index c958d7da..bb8819ec 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 \ # -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 \ # -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 -d ./arduino/splitflap \ - -e esp32 \ + pio run \ + -e esp32CustomAdvanced - 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 \ -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 \ -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 \ # -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 f7863c4e..f6a324df 100644 --- a/README.md +++ b/README.md @@ -473,7 +473,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/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. 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 98% rename from arduino/splitflap/esp32/base/base_supervisor_task.h rename to firmware/esp32/base/base_supervisor_task.h index 39da7528..168b1c92 100644 --- a/arduino/splitflap/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/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 99% rename from arduino/splitflap/esp32/tester/tester_task.h rename to firmware/esp32/tester/tester_task.h index b7a03f06..425ebbd1 100644 --- a/arduino/splitflap/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/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 99% rename from arduino/splitflap/Splitflap/src/Adafruit_INA219.h rename to firmware/src/Adafruit_INA219.h index a84786f8..e46de474 100644 --- a/arduino/splitflap/Splitflap/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/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 89% rename from arduino/splitflap/platformio.ini rename to platformio.ini index cdc97150..ecd31a47 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 @@ -111,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 = @@ -153,3 +151,11 @@ lib_deps = adafruit/Adafruit MCP23017 Arduino Library @ ^1.3.0 adafruit/Adafruit BusIO @ ^1.9.1 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} + -DNUM_MODULES=6 \ No newline at end of file