Skip to content
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
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: actions/cache@v4
with:
path: ~/.platformio
key: pio-${{ hashFiles('platformio.ini') }}
- run: pip install platformio
- run: pio run
- uses: actions/upload-artifact@v4
with:
name: firmware-esp32dev
path: |
.pio/build/esp32dev/firmware.bin
.pio/build/esp32dev/bootloader.bin
.pio/build/esp32dev/partitions.bin
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release

# Pushing a tag like v0.1.0 builds the firmware and publishes a GitHub
# Release with a single merged image that can be flashed at offset 0x0:
# esptool.py --chip esp32 write_flash 0x0 msns-firmware-esp32dev-v0.1.0.bin

on:
push:
tags: ["v*"]

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
env:
BOARD: esp32dev
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install platformio "esptool<5"
- run: pio run -e "$BOARD"
- name: Merge into one flashable image
run: |
out="msns-firmware-${BOARD}-${GITHUB_REF_NAME}.bin"
build=".pio/build/${BOARD}"
boot_app0="$HOME/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin"
esptool.py --chip esp32 merge_bin -o "$out" \
--flash_mode dio --flash_freq 40m --flash_size 4MB \
0x1000 "$build/bootloader.bin" \
0x8000 "$build/partitions.bin" \
0xe000 "$boot_app0" \
0x10000 "$build/firmware.bin"
sha256sum "$out" > "$out.sha256"
echo "IMAGE=$out" >> "$GITHUB_ENV"
- name: Publish release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "$GITHUB_REF_NAME" "$IMAGE" "$IMAGE.sha256" \
--title "$GITHUB_REF_NAME" --generate-notes
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog

All notable changes to this repository are recorded here.
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased]

### Added
- MIT `LICENSE` file (the README badge already pointed at one).
- CI build of the `esp32dev` environment on every push and pull request.
- Release workflow: pushing a `v*` tag publishes a merged, single-file
firmware image and its SHA-256.

### Fixed
- Comment on the GPS globals said they were written by `task_sensors`;
they are written by `task_serial` and read by `task_sensors`.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Shivtej Gaikwad and the Multi-Sensor Navigation System contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 4 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ bool has_mpu = false;
bool has_qmc = false;
bool has_bmp = false;

// Last known good GPS state — written and read exclusively by task_sensors
// (Core 1). task_serial (Core 0) never touches these globals directly;
// it only reads rows already in the ring buffer.
// Cross-core access exists but is benign for logging (no RMW, snapshot semantics).
// Last known good GPS state — written by task_serial (Core 0), which drains
// the GPS UART, and snapshotted into each row by task_sensors (Core 1).
// Single writer, single reader, no read-modify-write. The 64-bit doubles can
// tear across cores; that is accepted for logging (see README).
volatile double gps_lat = 0.0;
volatile double gps_lon = 0.0;
volatile float gps_alt = 0.0f;
Expand Down
Loading