Skip to content

Fix FCR macro collision with Renesas device headers (v1.4.1) - #40

Merged
NT7S merged 8 commits into
masterfrom
fix/fcr-macro-collision
Nov 28, 2026
Merged

NT7S merged 8 commits into
masterfrom
fix/fcr-macro-collision

Conversation

@NT7S

@NT7S NT7S commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes a real compile failure on Renesas targets (Arduino UNO R4 WiFi).

The dead #define FCR (rs->fcr) in src/int.h expanded the FCR hardware register name in the RA4M1 device header (R7FA4M1AB.h), causing a syntax error (expected ')' before '->' token) in JTEncode.cpp, encode_rs_int.cpp, and init_rs_int.cpp. JTEncode.h includes int.h before Arduino.h, so the macro was in force when the device header was parsed. The macro was never used (the fcr struct field is accessed directly), so it was removed.

Also included:

  • Bump version to 1.4.1 and document the fix in the README changelog
  • Add a sanitized WSPR_Beacon_UnoR4WiFi example: a WSPR beacon that transmits every 10 minutes on 30 m using the ESP32-S3 module for NTP time sync. Generic callsign/grid, placeholder credentials via arduino_secrets.h.example, .gitignore for arduino_secrets.h
  • Random frequency per transmit: each WSPR packet is transmitted at a random frequency inside the 200 Hz window (10.1401-10.1403 MHz) via the Uno R4 WiFi's hardware TRNG (random(), not seeded)
  • Transmit instant is 1 second into the even minute (hh:XX:01), per the WSPR spec
  • Clarify the WiFi signal-strength readout (WiFi signal strength:)
  • Add a build-matrix CI workflow that compiles a hardware-independent smoke sketch against the repo library on AVR (UNO), ATSAMD (MKR 1000), ESP32 (Dev Module), ESP8266 (NodeMCU 1.0) and Renesas (UNO R4 WiFi) — verifying the library builds and links on the major Arduino architectures, and guarding against arduino-cli's silent fallback to an installed copy

Verification

  • 17-check test harness — 17/17 PASS
  • Build matrix (AVR / ATSAMD / ESP32 / ESP8266 / Renesas) — all pass (see CI checks)
  • Uno R4 WiFi build — clean, 0 warnings/errors
  • Sanitized example compiles against the repo library (no arduino_secrets.h present — the __has_include fallback path)

Not verified

  • Actual Si5351 transmission on the hardware (needs the board)
  • NTP round trip on the real ESP32-S3 WiFi bridge (needs the board)

NT7S added 8 commits November 28, 2026 17:48
The dead #define FCR (rs->fcr) in src/int.h expanded the FCR hardware
register name in the RA4M1 device header (R7FA4M1AB.h) and broke
compilation on the Arduino UNO R4 WiFi (and other Renesas targets).
The macro was never used (the struct field is accessed directly), so
it was removed.

Bump version to 1.4.1 and document in the changelog.
A WSPR beacon for the Arduino Uno R4 WiFi that transmits a packet
every 10 minutes on 30 m using the ESP32-S3 module for NTP time sync.
The sketch is sanitized (generic callsign/grid, placeholder credentials
via arduino_secrets.h.example) and compiles without credentials.
The connectWiFi() status line printed 'Signal strength: ', which could be
confused with the WSPR message power level. It now prints 'WiFi signal
strength: ' to distinguish the two.
Each transmit now picks a random frequency inside the 30 m WSPR Tx
window (10.1401-10.1403 MHz, 200 Hz wide), per the WSPR spec's
'choose a transmission frequency somewhere in the 200 Hz-wide standard
WSPR bands'. Uses the Uno R4 WiFi's hardware TRNG via random() (do NOT
seed it with randomSeed(), which would disable the TRNG).
WSPR transmissions start at hh:XX:01 (1 second after the start of each
even UTC minute), not hh:XX:02. Update both the transmit instant and
the comments.
… ESP8266, Renesas

Adds a hardware-independent smoke sketch (tests/build-smoke) that
exercises every encode path, and a build-matrix workflow that compiles it
against the repo library (not an installed copy) for each core. The
verbose-log guard fails the job if the repo library is not what was
compiled, catching arduino-cli's silent fallback to an installed copy.
The arduino-lint library-spec rule (LD003) requires sketches to live in
examples/ or extras/, so the committed tests/build-smoke sketch failed
lint. The workflow now generates the sketch via a heredoc at build time
(untracked), keeping the library spec valid while still compiling the
repo library against AVR, ATSAMD, ESP32, ESP8266 and Renesas.
@NT7S
NT7S merged commit d058adb into master Nov 28, 2026
7 checks passed
@NT7S
NT7S deleted the fix/fcr-macro-collision branch November 30, 2026 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant