Skip to content

Commit

Permalink
Move firmware and continue removing vestiges of Arduino IDE support
Browse files Browse the repository at this point in the history
  • Loading branch information
scottbez1 committed Oct 6, 2024
1 parent d24230a commit 7481d21
Show file tree
Hide file tree
Showing 79 changed files with 24 additions and 86 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/pio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,42 +39,42 @@ 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
# - name: Build Firmware (chainlinkDriverTester)
# # 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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ sensor.xml

# Arduino compiled output
*.hex

.pio
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
67 changes: 0 additions & 67 deletions arduino/splitflap/.travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion arduino/splitflap/.gitignore → firmware/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
*/

#include "../config.h"
#include "config.h"
#if INA219_POWER_SENSE

#include "Arduino.h"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
#pragma once

#include "../config.h"
#include "config.h"

#if HOME_CALIBRATION_ENABLED
enum HomeState {
Expand Down
File renamed without changes.
8 changes: 6 additions & 2 deletions arduino/splitflap/platformio.ini → platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7481d21

Please sign in to comment.