Skip to content

ui: fix centred messages aborting on 280 pixel displays - #352

Closed
bota87 wants to merge 2 commits into
Blockstream:masterfrom
bota87:fix-abort-screen
Closed

bota87 wants to merge 2 commits into
Blockstream:masterfrom
bota87:fix-abort-screen

Conversation

@bota87

@bota87 bota87 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

On the Waveshare Touch LCD 2 (280 pixel high display) a centred message of two or three lines with no title bar fails an assertion and aborts the firmware.

make_show_message_activity() centres these messages with a top padding and asserts toppad < 100. The limit was raised from 50 to 100 in 880aafc for the bigger displays, but it is a hand picked number: at 240 pixels the padding is 87 for three lines and 98 for two, at 280 pixels it is 107 and 118. The padding is stored in a uint8_t, so the first commit checks that limit instead.

Two screens are built this way today:

  1. the "Internal error" screen in jade_abort(), so an abort shows nothing and the device stays on the screen it was on;
  2. "Preparing for firmware update" in ota_util.c, at the start of an OTA.

I found it with the first one, on a Touch LCD 2 that was aborting at boot because of #351: instead of the error message the device just sat on the splash screen. I have not run an OTA on one of these displays, but that message is built the same way, so it should fail there too.

The second commit is not needed for this bug. It makes jade_abort() try the message only once, so if the error screen fails for some other reason the abort goes straight through instead of calling itself again.

Tested on a Waveshare Touch LCD 3.5 (the board of #330, same 280 pixel display) with a temporary JADE_ABORT() added at boot: with both commits the error screen appears, with the dialogs.c change reverted it does not.

make_show_message_activity() asserts that the padding used to centre a
multi-line message is below 100, a limit scaled by hand for displays up to
about 240 pixels high. On the 280 pixel Waveshare Touch LCD 2 a two or three
line message with no title bar needs more than that, so it aborts - and the
"Internal error" screen shown by jade_abort() is one of those messages.

The padding is stored as a uint8_t, so check against that instead.
If showing the "Internal error" message fails an assertion, jade_abort() is
called again and tries to show the same message again, which fails in the
same way, so the device stays on whatever was on screen. Only try once, so
a second failure goes straight on to the real abort.
@jgriffiths

Copy link
Copy Markdown
Collaborator

Merged with minor tweak - thanks!

@jgriffiths jgriffiths closed this Sep 23, 2026
@bota87
bota87 deleted the fix-abort-screen branch September 23, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants