-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(baseui): tier the emote set by flash class #11257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #pragma once | ||
|
|
||
| // Central flash-class ladder: flash-sized tables key their per-platform tier off | ||
| // MESHTASTIC_FLASH_CLASS. Classes rank the *app flash region* a target actually has | ||
| // to spend - not raw part size, and deliberately not RAM. | ||
| // | ||
| // FLASH_CLASS_TINY <256 KB app region STM32WL | ||
| // FLASH_CLASS_SMALL ~784 KB nRF52840 (0x26000..0xEA000, warm store reserved) | ||
| // FLASH_CLASS_MEDIUM ~1.9-3 MB app part. classic ESP32 / S2 / C3, RP2040/RP2350 | ||
| // FLASH_CLASS_LARGE 4 MB+ app, or host ESP32-S3 / C6 / P4, portduino | ||
| // | ||
| // This is the sibling of memory/MemClass.h, and the two ladders disagree on purpose. | ||
| // MemClass ranks usable app heap; a chip can be poor in one resource and rich in the | ||
| // other. Classic ESP32 and nRF52840 are both MEM_CLASS_SMALL, but the ESP32 has well | ||
| // over twice the app flash, so a flash-shaped decision keyed off MESHTASTIC_MEM_CLASS | ||
| // would trim the wrong targets. The reverse trap is just as real within a single class: | ||
| // rak4631 and nrf52_promicro_diy_tcxo are the same chip and the same FLASH_CLASS_SMALL, | ||
| // yet one ships with ~22 KB of headroom and the other does not fit at all - so a class | ||
| // is a *default*, never a verdict. Tight variants predefine their own value. | ||
| // | ||
| // Compare ordinally (>=). An unclassified chip lands in SMALL on purpose: a smaller | ||
| // table is a recoverable default, an image that overruns its region is not. Consumer | ||
| // ladders stay #ifndef-guarded so a variant can always override. Requires the ARCH_* | ||
| // macros, so include after (or via) configuration.h. | ||
|
|
||
| #define FLASH_CLASS_TINY 1 | ||
| #define FLASH_CLASS_SMALL 2 | ||
| #define FLASH_CLASS_MEDIUM 3 | ||
| #define FLASH_CLASS_LARGE 4 | ||
|
|
||
| #ifndef MESHTASTIC_FLASH_CLASS | ||
| #if defined(ARCH_STM32WL) | ||
| #define MESHTASTIC_FLASH_CLASS FLASH_CLASS_TINY | ||
| #elif defined(ARCH_NRF52) || defined(ARCH_NRF54L15) | ||
| #define MESHTASTIC_FLASH_CLASS FLASH_CLASS_SMALL | ||
| #elif defined(ARCH_PORTDUINO) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C6) || \ | ||
| defined(CONFIG_IDF_TARGET_ESP32P4) | ||
| // S3/C6/P4 boards overwhelmingly ship 8-16 MB. The 4 MB-part S3 variants that run | ||
| // close to their app partition predefine MESHTASTIC_FLASH_CLASS instead. | ||
| #define MESHTASTIC_FLASH_CLASS FLASH_CLASS_LARGE | ||
| #elif defined(ARCH_ESP32) || defined(ARCH_RP2040) | ||
| #define MESHTASTIC_FLASH_CLASS FLASH_CLASS_MEDIUM | ||
| #else | ||
| #define MESHTASTIC_FLASH_CLASS FLASH_CLASS_SMALL | ||
| #endif | ||
| #endif // MESHTASTIC_FLASH_CLASS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: meshtastic/firmware
Length of output: 199
🏁 Script executed:
Repository: meshtastic/firmware
Length of output: 9453
🏁 Script executed:
Repository: meshtastic/firmware
Length of output: 4519
Fix the empty
emotes[]definition forEMOTE_SET_NONE.With
MESHTASTIC_EMOTE_SET=EMOTE_SET_NONE, every initializer is removed, leaving an unknown-bound empty array declaration that fails beforenumEmotesor the static assertion are reached. Use a placeholder ONE-element array for the NONE branch and keepnumEmotesat0; use the current table for non-empty tiers.🤖 Prompt for AI Agents