Repository navigation
Description
Problem
Building the LPC845-BRK environment via the PlatformIO backend (bash compile lpc845brk --examples AutoResearch --platformio) fails with C++14 digit-separator parse errors:
lib\FastLED/platforms/arm/common/m0clockless_c.h:358:71: error: missing terminating ' character
lib\FastLED/platforms/arm/common/m0clockless_c.h:358:47: error: expected ')' before '\x393939'
Line 358 of src/platforms/arm/common/m0clockless_c.h:
return (fl::u32)(((u64)ns * (u64)F_CPU + 999'999'999ULL) / 1'000'000'000ULL);The 999'999'999ULL and 1'000'000'000ULL are C++14 digit separators (P0245R1). Under -std=gnu++11 (PlatformIO's default for this environment) the compiler reads the single quote as a character-literal delimiter and chokes on the next 3 digits as '999' -> '\x393939'.
Why this blocks LPC bisection (#3325 / #3300)
To bisect the Arduino-core LPC8xx commit that broke bring-up, we need to build with a controllable framework version. fbuild (the default backend) has no per-commit pinning mechanism, so we're forced through PlatformIO, which respects platform_packages = framework-arduino-lpc8xx@<repo>#<sha> and re-fetches per pin. But PIO uses the older C++ standard by default, and the compile dies in FastLED's own header before we can even start.
This is a bisection blocker for #3300 / #3325.
Two-part fix
Part A (FastLED-side): make FastLED's m0clockless_c.h compile under both C++11 and C++14+
Easy and backwards-compatible. The single-quote separators are pure visual sugar; replace with plain digits:
- return (fl::u32)(((u64)ns * (u64)F_CPU + 999'999'999ULL) / 1'000'000'000ULL);
+ return (fl::u32)(((u64)ns * (u64)F_CPU + 999999999ULL) / 1000000000ULL);Audit the rest of src/ for other digit-separator usages -- ban them via a small lint check (bare_digit_separator_checker.py) so this regression can't return when a contributor adds C++14 syntax to a file that downstream builds compile under C++11. The lint should give a clear "use plain digits for cross-standard compatibility" message.
Part B (PIO platform side): default the LPC environment to gnu++17
In [env:lpc845brk] in platformio.ini (and lpcxpresso804 / lpcxpresso845max if present):
build_unflags =
-std=gnu++11
-std=c++11
build_flags =
-std=gnu++17
...The fbuild backend already defaults to -std=gnu++17 for LPC (verified in ~/.fbuild/worktrees/lpc8xx-orch/crates/fbuild-build/src/nxplpc/configs/nxplpc.json). Bringing PIO into parity prevents a class of "fbuild builds but PIO doesn't" surprises that block bisection and CI parity.
Open question on Part B: does the cleaner home for this default live in the zackees/platform-nxplpc-arduino platform.json (as a build block) rather than every consumer's platformio.ini? That would let third-party users get the right default without copy-pasting flags. Either is fine for #3300; whichever the maintainer prefers.
Acceptance criteria
- FastLED's
m0clockless_c.h:358(and any other digit-separator sites grep finds) replaced with plain digits. - New
ci/lint_cpp/digit_separator_checker.pyflags any future<digit>'<digit>pattern insrc/outside of suppressed sites. Lint passes on master. -
bash compile lpc845brk --examples AutoResearch --platformiosucceeds without manualbuild_flagsplumbing in the caller'splatformio.ini. -
bash compile lpc845brk --examples AutoResearch(default fbuild backend) continues to succeed at-std=gnu++17.
Verification commands
# Should fail at master HEAD; should pass after the fix.
bash compile lpc845brk --examples AutoResearch --platformio
# Should still pass.
bash compile lpc845brk --examples AutoResearch
bash test --cppRefs
- [BLOCKER] LPC845-BRK AutoResearch bring-up echo returns empty RX (suspected HardFault) — blocks #3102 #3300 -- LPC845-BRK bring-up echo silence (root investigation; this issue blocks the bisection step).
- [#3300 bisect] Find the commit that broke LPC845-BRK JSON-RPC echo — bisect Arduino-core LPC8xx #3325 -- bisection plan for Arduino-core LPC8xx.
zackees/platform-nxplpc-arduino-- the PIO platform whoseplatform.jsoncould carry thegnu++17default.
Filed mid-bisect on #3300 -- the digit-separator parse error blocked the very first bisect step (pin to last-known-working 4560e6c41d).
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
fix(lpc): unblock LPC PIO build — drop C++14 digit separators + force…
revert(lpc): drop -std=gnu++17 overrides; PIO defaults now compile (#…
revert(lpc): drop -std=gnu++17 overrides; PIO defaults now compile (#…
fix(lpc): unblock LPC PIO build — drop C++14 digit separators + force…