OpenMenuOS is designed to run on constrained microcontrollers where every millisecond and every kilobyte matters. By enabling the right options and avoiding a few common pitfalls, you can get fast, fluid menus even on an ESP8266 driving a mid-size TFT.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/The-Young-Maker/OpenMenuOS/llms.txt
Use this file to discover all available pages before exploring further.
Frame comparison optimization
The most impactful single setting issetOptimizeDisplayUpdates(true). When enabled, the library compares the current canvas frame against the previous one before transferring it to the display over SPI. If nothing has changed, the transfer is skipped entirely — saving both CPU cycles and SPI bus time.
Animation control
Smooth scroll and selection animations look polished but cost CPU. Disabling them gives a snappier, instant-response feel that works well on lower-powered hardware or when your application is doing significant work elsewhere inloop().
Button press animations are controlled separately with
setButtonAnimation(bool). You can disable button animations while keeping menu scroll animations, or vice versa.Text scroll control
Long menu item labels scroll horizontally by default. Each scroll step redraws the item, which increases the number of canvas writes per frame. If your labels are short enough to fit or you prefer static truncation, disable scrolling:Memory tips
SettingsScreen item limit
SettingsScreen supports up to 10 settings items (MAX_ITEMS = 10). Exceeding this limit causes undefined behavior. Plan your settings hierarchy to stay within this bound per screen; use addSubscreenSetting() to link to a second SettingsScreen for overflow items.
Avoid deep nesting
Each navigation level pushes the current screen ontoScreenManager’s history stack, which is a heap-allocated std::vector. Deeply nested menus — more than 4–5 levels — add both RAM pressure and code complexity. Flatten your hierarchy where possible.
Static variables in callbacks
Menu item action callbacks are called repeatedly whenever the item is selected. Avoid heap allocations inside them. Usestatic local variables for any state you need to persist across calls:
Avoid blocking code in callbacks
Anydelay() or long-running operation inside a callback blocks the entire loop(). PopupManager::update() and menu.loop() stop executing for the duration. Use non-blocking patterns with millis() timing instead:
Display tips
- Solid colors over gradients: Anti-aliased and gradient draws cost more time than solid fills. Prefer flat color schemes for items and backgrounds.
- Concise popup messages: Popup word-wrapping requires measuring and breaking text on each render. Short messages reduce that overhead.
- Icons: If using menu item icons, keep them small (16×16 pixels or less). Larger images take more time to blit onto the canvas.