Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c808d05
Add initial plan for Clean Architecture refactor of firmware
andre-stefanov May 11, 2026
0ec03b2
Potential fix for pull request finding
andre-stefanov May 11, 2026
d99f551
Multiple preparations for extended testing
andre-stefanov May 11, 2026
2c957bb
Merge branch 'develop' into feature/fff-testing
ClutchplateDude May 12, 2026
6d2e02c
Potential fix for pull request finding
andre-stefanov May 12, 2026
5b9b44d
Add formatting scripts and update configuration for code style enforc…
andre-stefanov May 12, 2026
8cc00d7
Add setup and teardown functions for unit tests in test_MappedDict
andre-stefanov May 12, 2026
264ebce
Update clang-format version 20 and remove source/exclude options in w…
andre-stefanov May 13, 2026
3c5049e
refactor: update clang-format workflow and improve formatting detection
andre-stefanov May 13, 2026
046663c
restored code_format.yml to develop
andre-stefanov May 13, 2026
2eb26d9
Merge branch 'develop' into feature/fff-testing
andre-stefanov May 13, 2026
43f1b9c
fix: revert clang-format version to 18 in workflow
andre-stefanov May 13, 2026
51643c5
Merge branch 'develop' into feature/fff-testing
andre-stefanov May 13, 2026
0940c04
style: apply clang-format fixes
openastrotech-bot May 13, 2026
a2bcb67
refactor: remove gcovr.cfg and native_coverage.py, update test-covera…
andre-stefanov May 13, 2026
3397ff7
chore: remove coverage reporting instructions from README.md
andre-stefanov May 13, 2026
c484979
chore: remove unused coverage_html.sh and format.sh scripts
andre-stefanov May 13, 2026
2370c87
refactor: update build flags and enhance coverage reporting in test-c…
andre-stefanov May 14, 2026
c9a565e
Merge branch 'develop' into feature/fff-testing
andre-stefanov May 14, 2026
22ee187
ci: update GitHub Actions to use latest versions of checkout and setu…
andre-stefanov May 14, 2026
856f8ca
ci: specify Python version in setup step for consistency
andre-stefanov May 14, 2026
014afa3
chore: update Changelog for version 1.13.20 with CI adjustments, depe…
andre-stefanov May 14, 2026
2450d43
chore: update version number to V1.13.20
andre-stefanov May 14, 2026
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
8 changes: 8 additions & 0 deletions .clang-format-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**/*.md

.github
.pio
.vscode
build_cache

scripts
17 changes: 15 additions & 2 deletions .github/workflows/platformio_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,25 @@ jobs:
continue-on-error: true

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install platformio
pip install gcovr
- name: Run Unit Tests
run: pio test -e native -v
- name: Publish Coverage Summary
if: always()
run: |
echo "## Native Unit Test Coverage" >> "$GITHUB_STEP_SUMMARY"
echo >> "$GITHUB_STEP_SUMMARY"
if [ -f .pio/coverage.md ]; then
cat .pio/coverage.md >> "$GITHUB_STEP_SUMMARY"
else
echo "Coverage report was not generated." >> "$GITHUB_STEP_SUMMARY"
fi
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ build_cache

Configuration_local*
MeadeToWikiOutput.txt

# macOS
**/.DS_Store
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
**V1.13.20 - Updates**
- CI adjustments
- Dependency updates
- Unit testing improvements

**V1.13.19 - Updates**
- Support inverting and mirroring InfoDisplays.

Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ This is an open source project and everyone is welcome to contribute. We will be

Even if Arduino IDE is supported, we highly recommend using VSCode with [PlatformIO](https://platformio.org/) for development. It allows automatic dependency management, powerful IDE, debugging, automatic build flags definition and more.

### Native unit tests
Comment thread
andre-stefanov marked this conversation as resolved.

Run the host-based unit tests with PlatformIO:

```shell
pio test -e native -v
```

This executes the tests under `unit_tests/test_common` without requiring any target hardware.

### Debugging

#### ATmega2560-based
Expand Down
2 changes: 1 addition & 1 deletion Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
// Also, numbers are interpreted as simple numbers. _ __ _
// So 1.8 is actually 1.08, meaning that 1.12 is a later version than 1.8. \_(..)_/

#define VERSION "V1.13.19"
#define VERSION "V1.13.20"
14 changes: 13 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ upload_protocol = wiring
build_flags =
${env.build_flags}
-D BOARD=BOARD_AVR_RAMPS
src_build_flags =
build_src_flags =
${env.src_build_flags}
-Wuseless-cast
debug_tool = avr-stub
Expand Down Expand Up @@ -139,3 +139,15 @@ build_flags =
[env:native]
platform = native
test_ignore = test_embedded
build_flags =
-O0
--coverage
-fprofile-arcs
-ftest-coverage
; Linker flag for coverage
extra_scripts = scripts/test-coverage.py
test_testing_command =
/usr/bin/env
python3
scripts/test-coverage.py
${platformio.build_dir}/${this.__env__}/program
68 changes: 68 additions & 0 deletions scripts/test-coverage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import os
import subprocess
from pathlib import Path
import sys
from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
def Import(*names: str) -> tuple[Any, ...]:
...

def _project_root():
return Path(__file__).resolve().parent.parent


def _native_build_dir():
return _project_root() / ".pio" / "build" / "native"


def _has_coverage_data():
return any(_native_build_dir().rglob("*.gcda"))


def ensure_gcovr_installed(build_env):
"""Checks if gcovr is installed, and installs it via pip if not."""
try:
import gcovr
except ImportError:
print("gcovr not found! Installing it into the PlatformIO environment...")
# $PYTHONEXE ensures we use PlatformIO's isolated Python environment, not the system OS Python
build_env.Execute("$PYTHONEXE -m pip install gcovr")


def generateCoverageInfo():
if not _has_coverage_data():
print("Skipping coverage report generation because no .gcda files were produced.")
return

print("Generating code coverage report...")
gcovr_cmd = ["gcovr"]
report_dir = _project_root()
# Adjust this path if you are testing multiple specific folders
subprocess.run(gcovr_cmd + ["--html-details", ".pio/coverage.html", "--filter", "src/"], check=True, cwd=report_dir)
print(f"Coverage report generated at: .pio/coverage.html")
subprocess.run(gcovr_cmd + ["--markdown", ".pio/coverage.md", "--filter", "src/"], check=True, cwd=report_dir)
print(f"Coverage report generated at: .pio/coverage.md")


def configure_build():
Import("env")
build_env = globals()["env"]
build_env.Append(LINKFLAGS=["--coverage"])
ensure_gcovr_installed(build_env)


def main(argv):
if not argv:
print("Usage: test-coverage.py <test-program> [args...]", file=sys.stderr)
return 2

completed = subprocess.run(argv, cwd=_project_root(), env=os.environ.copy(), check=False)
generateCoverageInfo()
return completed.returncode


if __name__ == "__main__":
raise SystemExit(main(sys.argv[1:]))

configure_build()
10 changes: 5 additions & 5 deletions src/Mount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ void Mount::configureAZStepper(byte pin1, byte pin2, int maxSpeed, int maxAccele
#ifdef NEW_STEPPER_LIB
_stepperAZ = new StepperAzSlew(AccelStepper::DRIVER, pin1, pin2);
#else
_stepperAZ = new AccelStepper(AccelStepper::DRIVER, pin1, pin2);
_stepperAZ = new AccelStepper(AccelStepper::DRIVER, pin1, pin2);
#endif
_stepperAZ->setMaxSpeed(maxSpeed);
_stepperAZ->setAcceleration(maxAcceleration);
Expand All @@ -377,7 +377,7 @@ void Mount::configureALTStepper(byte pin1, byte pin2, int maxSpeed, int maxAccel
#ifdef NEW_STEPPER_LIB
_stepperALT = new StepperAltSlew(AccelStepper::DRIVER, pin1, pin2);
#else
_stepperALT = new AccelStepper(AccelStepper::DRIVER, pin1, pin2);
_stepperALT = new AccelStepper(AccelStepper::DRIVER, pin1, pin2);
#endif
_stepperALT->setMaxSpeed(maxSpeed);
_stepperALT->setAcceleration(maxAcceleration);
Expand Down Expand Up @@ -774,7 +774,7 @@ void Mount::configureALTdriver(uint16_t ALT_SW_RX, uint16_t ALT_SW_TX, float rse
_driverALT->pdn_disable(true);
#if UART_CONNECTION_TEST_TXRX == 1
bool UART_Rx_connected = false;
UART_Rx_connected = connectToDriver("ALT");
UART_Rx_connected = connectToDriver("ALT");
if (!UART_Rx_connected)
{
digitalWrite(ALT_EN_PIN,
Expand Down Expand Up @@ -865,7 +865,7 @@ void Mount::configureFocusDriver(
_driverFocus->pdn_disable(true);
#if UART_CONNECTION_TEST_TXRX == 1
bool UART_Rx_connected = false;
UART_Rx_connected = connectToDriver("FOC");
UART_Rx_connected = connectToDriver("FOC");
if (!UART_Rx_connected)
{
digitalWrite(FOCUS_EN_PIN,
Expand Down Expand Up @@ -1940,7 +1940,7 @@ void Mount::getAZALTPositions(long &azPos, long &altPos)
#if (AZ_STEPPER_TYPE != STEPPER_TYPE_NONE)
azPos = _stepperAZ->currentPosition();
#else
azPos = 0;
azPos = 0;
#endif
#if (ALT_STEPPER_TYPE != STEPPER_TYPE_NONE)
altPos = _stepperALT->currentPosition();
Expand Down
28 changes: 14 additions & 14 deletions src/Mount.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@ using StepperFocusSlew = InterruptAccelStepper<config::Focus::stepper_slew>;
#else
#include "AccelStepper.h"
class AccelStepper;
using StepperRaSlew = AccelStepper;
using StepperRaTrk = AccelStepper;
using StepperDecSlew = AccelStepper;
using StepperDecTrk = AccelStepper;
using StepperRaSlew = AccelStepper;
using StepperRaTrk = AccelStepper;
using StepperDecSlew = AccelStepper;
using StepperDecTrk = AccelStepper;

#if AZ_STEPPER_TYPE != STEPPER_TYPE_NONE
using StepperAzSlew = AccelStepper;
using StepperAzSlew = AccelStepper;
#endif

#if ALT_STEPPER_TYPE != STEPPER_TYPE_NONE
using StepperAltSlew = AccelStepper;
using StepperAltSlew = AccelStepper;
#endif

#if ALT_STEPPER_TYPE != STEPPER_TYPE_NONE
using StepperAltSlew = AccelStepper;
using StepperAltSlew = AccelStepper;
Comment thread
andre-stefanov marked this conversation as resolved.
#endif

#if FOCUS_STEPPER_TYPE != STEPPER_TYPE_NONE
Expand All @@ -61,21 +61,21 @@ using StepperFocusSlew = AccelStepper;
#else
#include "AccelStepper.h"
class AccelStepper;
using StepperRaSlew = AccelStepper;
using StepperRaTrk = AccelStepper;
using StepperDecSlew = AccelStepper;
using StepperDecTrk = AccelStepper;
using StepperRaSlew = AccelStepper;
using StepperRaTrk = AccelStepper;
using StepperDecSlew = AccelStepper;
using StepperDecTrk = AccelStepper;

#if AZ_STEPPER_TYPE != STEPPER_TYPE_NONE
using StepperAzSlew = AccelStepper;
using StepperAzSlew = AccelStepper;
#endif

#if ALT_STEPPER_TYPE != STEPPER_TYPE_NONE
using StepperAltSlew = AccelStepper;
using StepperAltSlew = AccelStepper;
#endif

#if ALT_STEPPER_TYPE != STEPPER_TYPE_NONE
using StepperAltSlew = AccelStepper;
using StepperAltSlew = AccelStepper;
#endif

#if FOCUS_STEPPER_TYPE != STEPPER_TYPE_NONE
Expand Down
2 changes: 1 addition & 1 deletion src/b_setup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ void setup()
#ifdef OAE
RA_SERIAL_PORT.begin(57600, SERIAL_8N1, RA_RX_PIN, RA_TX_PIN);
#else
RA_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver
RA_SERIAL_PORT.begin(57600); // Start HardwareSerial comms with driver
#endif
//
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/fonts128x64.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include <Arduino.h>

// clang-format off
// Font generated or edited with the glyphEditor
const uint8_t Bitmap3x5[] PROGMEM = {
0x03, // Width: 3
Expand Down Expand Up @@ -441,3 +442,4 @@ const uint8_t OATLogo[] PROGMEM = {
// Font Data:
0x00, 0x0E, 0x00, 0x80, 0x31, 0x00, 0xC0, 0x40, 0x00, 0x40, 0x00, 0x00, 0x20, 0x00, 0x00, 0x10, 0x01, 0x00, 0x10, 0x00, 0x00, 0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x20, 0x05, 0x00, 0x40, 0x03, 0x00, 0x80, 0x03, 0x00, 0xF5, 0x5F, 0x01, 0x80, 0x03, 0x00, 0x40, 0x05, 0x00, 0x40, 0x41, 0x00, 0x00, 0x41, 0x00, 0x00, 0x20, 0x00, 0x00, 0x21, 0x00, 0x00, 0x10, 0x00, 0x00, 0x11, 0x00, 0x00, 0x08, 0x00, 0x08, 0x0C, 0x00, 0x30, 0x06, 0x00, 0xC0, 0x01, // 33
};
// clang-format on
1 change: 1 addition & 0 deletions src/libs/.clang-format-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TimerInterrupt/**
1 change: 1 addition & 0 deletions unit_tests/test_common/fakes/.clang-format-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fff.h
Comment thread
andre-stefanov marked this conversation as resolved.
Loading
Loading