Repository navigation
fix(thinknode_m9): define SPI_FREQUENCY for the non-MUI build - #11546
Conversation
The M9's variant.h defines ST7789_CS, so TFTDisplay.cpp compiles its ST7789 LGFX branch, which reads SPI_FREQUENCY for the panel write clock (SPI_READ_FREQUENCY, its pair, is already in variant.h). The flag was only set in the -tft env, so `build (thinknode_m9, esp32s3)` has failed on develop since the board landed in #10908: src/graphics/TFTDisplay.cpp:504:30: error: 'SPI_FREQUENCY' was not declared in this scope; did you mean 'SD_SPI_FREQUENCY'? Move the flag up into thinknode_m9_base, keeping the 75 MHz the -tft env already used for the same panel and matching the SD card's 75 MHz on the bus they share. The -tft env inherits the base flags, so device-ui's LGFX_GENERIC.h - which falls back to 20 MHz when the macro is absent - still sees the identical value.
⚡ Try this PR in the Web FlasherNote Building this pull request… the flash button, badges and supported-board |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe ThinkNode M9 configuration now defines ChangesThinkNode M9 SPI configuration
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This change defines the existing 75 MHz SPI write frequency for the plain ThinkNode M9 build while preserving the TFT build configuration. It addresses the build failure without changing runtime behavior for the existing TFT environment, and no actionable merge-blocking risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…stic#11546) The M9's variant.h defines ST7789_CS, so TFTDisplay.cpp compiles its ST7789 LGFX branch, which reads SPI_FREQUENCY for the panel write clock (SPI_READ_FREQUENCY, its pair, is already in variant.h). The flag was only set in the -tft env, so `build (thinknode_m9, esp32s3)` has failed on develop since the board landed in meshtastic#10908: src/graphics/TFTDisplay.cpp:504:30: error: 'SPI_FREQUENCY' was not declared in this scope; did you mean 'SD_SPI_FREQUENCY'? Move the flag up into thinknode_m9_base, keeping the 75 MHz the -tft env already used for the same panel and matching the SD card's 75 MHz on the bus they share. The -tft env inherits the base flags, so device-ui's LGFX_GENERIC.h - which falls back to 20 MHz when the macro is absent - still sees the identical value.
Problem
build (thinknode_m9, esp32s3)has failed on every develop run since #10908 landed. develop was green through5dffd2258, red fromc308d0acaonward, and this is currently the only failing job on develop.The M9's
variant.hdefinesST7789_CS, soTFTDisplay.cppcompiles its ST7789LGFXbranch, which readsSPI_FREQUENCYfor the panel write clock —SPI_READ_FREQUENCY, its pair, is already invariant.h. But-D SPI_FREQUENCY=75000000was only set in[env:thinknode_m9-tft], so the plain env has never compiled.Change
Move the flag from the
-tftenv up intothinknode_m9_base, keeping the 75 MHz the-tftenv already used for the same panel — and matchingSD_SPI_FREQUENCYon the bus the two share.It stays a build flag rather than moving into
variant.hbecause device-ui'sLGFX_GENERIC.hdoesn't includevariant.h: it readsSPI_FREQUENCYitself and silently falls back to#define SPI_FREQUENCY 20000000when the macro is absent. One flag on the base keeps both consumers on the same value.thinknode_m9-tftis unaffected — it inherits${thinknode_m9_base.build_flags}.Tests
Resolved flags, via
pio project config --json-output— the MUI env is unchanged, the plain env gains the macro:pio run -e thinknode_m9: SUCCESS in 7:17, zero errors,src/graphics/TFTDisplay.cpp.ocompiles clean.No M9 hardware on hand, so this is a build fix verified by building. Since
thinknode_m9-tft's resolved flags are identical to before, the MUI build is byte-for-byte unchanged and needs no re-test on device.Summary by CodeRabbit