Conversation
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.
Collaborator
|
Merged with minor tweak - thanks! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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:
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.