Do not perform redundant reset on ST7789 displays#2475
Open
JosiahWI wants to merge 1 commit intomeshcore-dev:devfrom
Open
Do not perform redundant reset on ST7789 displays#2475JosiahWI wants to merge 1 commit intomeshcore-dev:devfrom
JosiahWI wants to merge 1 commit intomeshcore-dev:devfrom
Conversation
The `::init` method in the Adafruit ST7789 library is responsible to initialize the device. This includes performing a reset, which can be found in the Adafruit source for `Adafruit_SPITFT`. Before this change, MeshCore performed its own ST7789 display reset sequence, which consisted of three steps. * Pull reset low * Wait 10ms * Pull reset high Importantly, there was no fixed delay after pulling reset high. The ST7789 driver requires a delay (T<sub>RT</sub>) of 5ms in Sleep In Mode and 120ms in Sleep Out Mode before it will properly receive commands. When `Adafruit_SPITFT` resets the device after MeshCore has already reset it, the mandatory time may not have elapsed, leading to strange behavior. In the author's case, this issue caused the initial `fillScreen` to fail, such that the display showed an uninitialized framebuffer. This removes the MeshCore delay, leaving the responsibility of reset to `Adafruit_SPITFT`, where they have the correct delays in place with extra safety margin. The change was briefly tested by Josiah VanderZee and Ben Zignego on a custom hardware build using an nRF52840 Dongle and an Adafruit 4311 TFT display. The user button seemed to behave strangely, but the display looked correct.
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.
The
::initmethod in the Adafruit ST7789 library is responsible to initialize the device. This includes performing a reset, which can be found in the Adafruit source forAdafruit_SPITFT.Before this change, MeshCore performed its own ST7789 display reset sequence, which consisted of three steps.
Importantly, there was no fixed delay after pulling reset high. The ST7789 driver requires a delay (TRT) of 5ms in Sleep In Mode and 120ms in Sleep Out Mode before it will properly receive commands. When
Adafruit_SPITFTresets the device after MeshCore has already reset it, the mandatory time may not have elapsed, leading to strange behavior. In the author's case, this issue caused the initialfillScreento fail, such that the display showed an uninitialized framebuffer.This removes the MeshCore delay, leaving the responsibility of reset to
Adafruit_SPITFT, where they have the correct delays in place with extra safety margin. The change was briefly tested by Josiah VanderZee and Ben Zignego on a custom hardware build using an nRF52840 Dongle and an Adafruit 4311 TFT display. The user button seemed to behave strangely, but the display looked correct.