firmware/src
todd-herbert 9fd100dd92
InkHUD UI for E-Ink (#6034)
* Decouple ButtonThread from sleep.cpp
Reorganize sleep observables. Don't call ButtonThread methods inside doLightSleep. Instead, handle in class with new lightsleep Observables.

* InkHUD: initial commit (WIP)
Publicly discloses the current work in progress. Not ready for use.

* feat: battery icon

* chore: implement meshtastic/firmware #5454
Clean up some inline functions

* feat: menu & settings for "jump to applet"

* Remove the beforeRender pattern
It hugely complicates things. If we can achieve acceptable performance without it, so much the better.

* Remove previous Map Applet
Needs re-implementation to work without the beforeRender pattern

* refactor: reimplement map applet
Doesn't require own position
Doesn't require the beforeRender pattern to precalculate; now all-at-once in render
Lays groundwork for fixed-size map with custom background image

* feat: autoshow
Allow user to select which applets (if any) should be automatically brought to foreground when they have new data to display

* refactor: tidy-up applet constructors
misc. jobs including:
- consistent naming
- move initializer-list-only constructors to header
- give derived applets unique identifiers for MeshModule and OSThread logging

* hotfix: autoshow always uses FAST update
In future, it *will* often use FAST, but this will be controlled by a WindowManager component which has not yet been written.
Hotfixed, in case anybody is attempting to use this development version on their deployed devices.

* refactor: bringToForeground no longer requests FAST update
In situations where an applet has moved to foreground because of user input, requestUpdate can be manually called, to upgrade to FAST refresh.
More permanent solution for #23e1dfc

* refactor: extract string storage from ThreadedMessageApplet
Separates the code responsible for storing the limited message history, which was previously part of the ThreadedMessageApplet.
We're now also using this code to store the "most recent message". Previously, this was stored in the `InkHUD::settings` struct, which was much less space-efficient.
We're also now storing the latest DM, laying the foundation for an applet to display only DMs, which will complement the threaded message applet.

* fix: text wrapping
Attempts to fix a disparity between `Applet::printWrapped` and `Applet::getWrappedTextHeight`, which would occasionally cause a ThreadedMessageApplet message to render "too short", overlapping other text.

* fix: purge old constructor
This one slipped through the last commit..

* feat: DM Applet
Useful in combination with the ThreadedMessageApplets, which don't show DMs

* fix: applets shouldn't handle events while deactivated
Only one or two applets were actually doing this, but I'm making a habit of having all applets return early from their event handling methods (as good practice), even if those methods are disabled elsewhere (e.g. not observing observable, return false from wantPacket)

* refactor: allow requesting update without requesting autoshow
Some applets may want to redraw, if they are displayed, but not feel the information is worth being brought to foreground for. Example: ActiveNodesApplet, when purging old nodes from list.

* feat: custom "Recently Active" duration
Allows users to tailor how long nodes will appear in the "Recents" applets, to suit the activity level of their mesh.

* refactor: rename some applets

* fix: autoshow

* fix: getWrappedTextHeight
Remove the "simulate" option from printWrapped; too hard to keep inline with genuine printing (because of AdafruitGFX Fonts' xAdvance, mabye?). Instead of simulating, we printWrapped as normal, and discard pixel output by setting crop. Both methods are similarly inefficient, apparently.

* fix: text wrapping in ThreadedMessageApplet
Wrong arguments were passed to Applet::printWrapped

* feat: notifications for text messages
Only shown if current applet does not already display the same info. Autoshow takes priority over notifications, if both would be used to display the same info.

* feat: optimize FAST vs FULL updates
New UpdateMediator class counts the number of each update type, and suggets which one to use, if the code doesn't already have an explicit prefence. Also performs "maintenance refreshes" unprovoked if display is not given an opportunity to before a FULL refresh through organic use.

* chore: update todo list

* fix: rare lock-up of buttons

* refactor: backlight
Replaces the initial proof-of-concept frontlight code for T-Echo
Presses less than 5 seconds momentarily illuminate the display
Presses longer than 5 seconds latch the light, requiring another tap to disable
If user has previously removed the T-Echo's capacitive touch button (some DIY projects), the light is controlled by the on-screen menu. This fallback is used by all T-Echo devices, until a press of the capacitive touch button is detected.

* feat: change tile with aux button
Applied to VM-E290.
Working as is, but a refactor of WindowManager::render is expected shortly, which will also tidy code from this push.

* fix: specify out-of-the-box tile assignments
Prevents placeholder applet showing on initial boot, for devices which use a mult-tile layout by default (VM-E290)

* fix: verify settings version when loading

* fix: wrong settings version

* refactor: remove unimplemented argument from requestUpdate
Specified whether or not to update "async", however the implementation was slightly broken, Applet::requestUpdate is only handled next time WindowManager::runOnce is called. This didn't allow code to actually await an update, which was misleading.

* refactor: renaming
Applet::render becomes Applet::onRender.
Tile::displayedApplet becomes Tile::assignedApplet.
New onRender method name allows us to move some of the pre and post render code from WindowManager into new Applet::render method, which will call onRender for us.

* refactor: rendering
Bit of a tidy-up. No intended change in behavior.

* fix: optimize refresh times
Shorter wait between retrying update if display was previously busy.
Set anticipated update durations closer to observed values. No signifacant performance increase, but does decrease the amount of polling required.

* feat: blocking update for E-Ink
Option to wait for display update to complete before proceeding. Important when shutting down the device.

* refactor: allow system applets to lock rendering
Temporarily prevents other applets from rendering.

* feat: boot and shutdown screens

* feat: BluetoothStatus
Adds a meshtastic::Status object which exposes the state of the Bluetooth connection. Intends to allow decoupling of UI code.

* feat: Bluetooth pairing screen

* fix: InkHUD defaults not honored

* fix: random Bluetooth pin for NicheGraphics UIs

* chore: button interrupts tested

* fix: emoji reactions show as blank messages

* fix: autoshow and notification triggered by outgoing message

* feat: save InkHUD data before reboot
Implemented with a new Observable. Previously, config and a few recent messages were saved on shutdown. These were lost if the device rebooted, for example when firmware settings were changed by a client. Now, the InkHUD config and recent messages saved on reboot, the same as during an intentional shutdown.

* feat: imperial distances
Controlled by the config.display.units setting

* fix: hide features which are not yet implemented

* refactor: faster rendering
Previously, only tiles which requested update were re-rendered. Affected tiles had their region blanked before render, pixel by pixel. Benchmarking revealed that it is significantly faster to memset the framebuffer and redraw all tiles.

* refactor: tile ownership
Tiles and Applets now maintain a reciprocal link, which is enforced by asserts. Less confusing than the old situation, where an applet and a tile may disagree on their relationship. Empty tiles are now identified by a nullptr *Applet, instead of by having the placeholderApplet assigned.

* fix: notifications and battery when menu open
Do render notifications in front of menu; don't render battery icon in front of menu.

* fix: simpler defaults
Don't expose new users to multiplexed applets straight away: make them enable the feature for themselves.

* fix: Inputs::TwoButton interrupts, when only one button in use

* fix: ensure display update is complete when ESP32 enters light sleep
Many panels power down automatically, but some require active intervention from us. If light sleep (ESP32) occurs during a display update, these panels could potentially remain powered on, applying voltage the pixels for an extended period of time, and potentially damaging the display.

* fix: honor per-variant user tile limit
Set as the default value for InkHUD::settings.userTiles.maxCount in nicheGraphics.h

* feat: initial InkHUD support for Wireless Paper v1.1 and VM-E213

* refactor: Heard and Recents Applets
Tidier code, significant speed boost. Possibly no noticable change in responsiveness, but rendering now spends much less time blocking execution, which is important for correction functioning of the other firmware components.

* refactor: use a common pio base config
Easier to make any future PlatformIO config changes

* feat: tips
Show information that we think the user might find helpful. Some info shown first boot only. Other info shown when / if relevant.

* fix: text wrapping for '\n'
Previously, the newline was honored, but the adojining word was not printed.

* Decouple ButtonThread from sleep.cpp
Reorganize sleep observables. Don't call ButtonThread methods inside doLightSleep. Instead, handle in class with new lightsleep Observables.

* feat: BluetoothStatus
Adds a meshtastic::Status object which exposes the state of the Bluetooth connection. Intends to allow decoupling of UI code.

* feat: observable for reboot

* refactor: Heltec VM-E290 installDefaultConfig

* fix: random Bluetooth pin for NicheGraphics UIs
2025-02-11 16:01:17 -06:00
..
buzz Add buzzer feedback on GPS toggle (#5090) 2024-10-18 14:40:18 +11:00
concurrency More reduction (#5256) 2024-11-04 19:15:59 -06:00
detect fix detection of lark weather station and add rain sensor (#5874) 2025-01-18 14:10:13 +01:00
Fusion Add support for BMX160/RAK12034 compass module (#4021) 2024-06-11 17:47:45 -05:00
gps T1000-E hardware updates and GPS positioning accuracy optimisation (#6003) 2025-02-07 10:02:56 +02:00
graphics InkHUD UI for E-Ink (#6034) 2025-02-11 16:01:17 -06:00
input Canned messages: allow GPIO0 with "scan and select" input (#5838) 2025-01-16 06:38:22 -06:00
mesh InkHUD UI for E-Ink (#6034) 2025-02-11 16:01:17 -06:00
modules 2.6 <- Next hop router (#6005) 2025-02-07 06:29:36 -06:00
motion Update RAK2560 code (#5844) 2025-01-20 09:34:54 +01:00
mqtt Fixes #5766 Updated MQTT privateCidrRanges to add Tailscale (#5957) 2025-01-29 06:14:43 -06:00
nimble InkHUD UI for E-Ink (#6034) 2025-02-11 16:01:17 -06:00
platform InkHUD UI for E-Ink (#6034) 2025-02-11 16:01:17 -06:00
serialization improve UTF-8 string handling in JSONValue (#6011) 2025-02-08 20:03:44 +08:00
airtime.cpp More log reductions. I'll probably stop now ;-) (#5263) 2024-11-06 21:03:25 +08:00
airtime.h Fix various typos (#2607) 2023-07-14 16:25:20 -05:00
AmbientLightingThread.h More reduction (#5256) 2024-11-04 19:15:59 -06:00
AudioThread.h Cherry pick tdeck fixes (#5422) 2024-11-22 14:25:09 -06:00
BluetoothCommon.cpp Revert "Sync Wio lr1110 refresh with master (#4288)" 2024-07-22 15:30:36 +02:00
BluetoothCommon.h Revert "Sync Wio lr1110 refresh with master (#4288)" 2024-07-22 15:30:36 +02:00
BluetoothStatus.h InkHUD UI for E-Ink (#6034) 2025-02-11 16:01:17 -06:00
ButtonThread.cpp InkHUD UI for E-Ink (#6034) 2025-02-11 16:01:17 -06:00
ButtonThread.h InkHUD UI for E-Ink (#6034) 2025-02-11 16:01:17 -06:00
commands.h Revert "Sync Wio lr1110 refresh with master (#4288)" 2024-07-22 15:30:36 +02:00
configuration.h fix detection of lark weather station and add rain sensor (#5874) 2025-01-18 14:10:13 +01:00
DebugConfiguration.cpp RAK13800 Ethernet improvements 2024-09-06 11:45:43 +02:00
DebugConfiguration.h Include log messages in unit tests (#5666) 2024-12-26 13:42:15 +11:00
DisplayFormatters.cpp Short turbo preset (#4465) 2024-08-14 21:16:21 -05:00
DisplayFormatters.h Refactor away some code duplication in screen frames and display formatter for modem presets (#2872) 2023-10-09 20:43:16 -05:00
error.h Remove deprecated MyNodeInfo fields (#2552) 2023-06-08 08:07:32 -05:00
freertosinc.h Make STM compile again and update toolchain. (#2960) 2024-07-25 20:16:21 -05:00
FSCommon.cpp Fix T-Deck SD card detection (#6023) 2025-02-10 07:41:37 -06:00
FSCommon.h Reboot before formatting LittleFS (#5900) 2025-01-20 11:43:35 -06:00
GpioLogic.cpp Log cleanups (#5135) 2024-11-04 06:09:23 -06:00
GpioLogic.h for #4154 use a binary gpio transformer to manage vext on heltec-tracker (saves power) 2024-08-28 11:25:54 -07:00
GPSStatus.h Log cleanups (#5135) 2024-11-04 06:09:23 -06:00
Led.cpp Finish powermon/powerstress (#4230) 2024-08-06 12:35:54 -05:00
Led.h Finish powermon/powerstress (#4230) 2024-08-06 12:35:54 -05:00
main.cpp InkHUD UI for E-Ink (#6034) 2025-02-11 16:01:17 -06:00
main.h InkHUD UI for E-Ink (#6034) 2025-02-11 16:01:17 -06:00
memGet.cpp First stab at enabling store and forward for Native 2024-09-28 11:37:27 +02:00
memGet.h - Abstract the memory stats into its own class. 2023-02-17 12:31:51 +01:00
meshUtils.cpp Remove assert in mesh-pb-constants.cpp (#5207) 2024-11-02 05:38:44 -05:00
meshUtils.h remove newline from logging statements. (#5022) 2024-10-14 15:11:43 +11:00
network-stubs.cpp trunk roundhouse kick 2023-01-21 21:23:24 +01:00
NodeStatus.h remove newline from logging statements. (#5022) 2024-10-14 15:11:43 +11:00
Observer.cpp trunk roundhouse kick 2023-01-21 21:23:24 +01:00
Observer.h Fix: return failure when PhoneAPI times out (#3136) 2024-01-28 07:53:39 -06:00
Power.cpp Update RAK2560 code (#5844) 2025-01-20 09:34:54 +01:00
power.h Update RAK2560 code (#5844) 2025-01-20 09:34:54 +01:00
PowerFSM.cpp Don't powersave on Wifi (#5443) 2024-11-25 06:53:05 -06:00
PowerFSM.h Add more exclude options to save program ram/flash (#4408) 2024-08-06 18:48:55 -05:00
PowerFSMThread.h Add more exclude options to save program ram/flash (#4408) 2024-08-06 18:48:55 -05:00
PowerMon.cpp remove newline from logging statements. (#5022) 2024-10-14 15:11:43 +11:00
PowerMon.h Finish powermon/powerstress (#4230) 2024-08-06 12:35:54 -05:00
PowerStatus.h remove newline from logging statements. (#5022) 2024-10-14 15:11:43 +11:00
RedirectablePrint.cpp Fix off-by-one error with log writes (#5959) 2025-01-28 19:57:52 -06:00
RedirectablePrint.h De-duplicate log-level determination (#5148) 2024-10-26 12:06:50 +02:00
RF95Configuration.h Remove unused define (#4620) 2024-09-02 20:08:02 -05:00
SafeFile.cpp NRF52 - Remove file totally before opening write (#5916) 2025-01-23 19:12:20 -06:00
SafeFile.h Cherrypick "add more locking for shared SPI devices (#5595) " (#5728) 2025-01-03 10:05:26 +08:00
SerialConsole.cpp De-duplicate log-level determination (#5148) 2024-10-26 12:06:50 +02:00
SerialConsole.h Revert "Sync Wio lr1110 refresh with master (#4288)" 2024-07-22 15:30:36 +02:00
shutdown.h InkHUD UI for E-Ink (#6034) 2025-02-11 16:01:17 -06:00
sleep.cpp InkHUD UI for E-Ink (#6034) 2025-02-11 16:01:17 -06:00
sleep.h InkHUD UI for E-Ink (#6034) 2025-02-11 16:01:17 -06:00
SPILock.cpp trunk roundhouse kick 2023-01-21 21:23:24 +01:00
SPILock.h If display is on on the @BigCorvus board and we xmit the board browns out? 2020-08-28 17:38:23 -07:00
Status.h InkHUD UI for E-Ink (#6034) 2025-02-11 16:01:17 -06:00
target_specific.h NRF52 bluetooth cleanup and fix (#3328) 2024-03-03 13:56:55 -06:00
xmodem.cpp Cherrypick "add more locking for shared SPI devices (#5595) " (#5728) 2025-01-03 10:05:26 +08:00
xmodem.h Make STM compile again and update toolchain. (#2960) 2024-07-25 20:16:21 -05:00