8000 Display sleep mode persists after soft reboot · Issue #45 · adafruit/Adafruit_CircuitPython_MacroPad · GitHub
[go: up one dir, main page]

Skip to content

Display sleep mode persists after soft reboot #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kalehmann opened this issue May 2, 2023 · 0 comments · Fixed by #46
Closed

Display sleep mode persists after soft reboot #45

kalehmann opened this issue May 2, 2023 · 0 comments · Fixed by #46

Comments

@kalehmann
Copy link
Contributor

Yesterday my pull request #44 that introduces a property for the display sleep mode was merged. Unfortunately after further testing I realized, that the sleep mode persists after a soft reboot of the device. This happens for example when I copy new code to the circuitpython drive.

Steps to reproduce

  1. Open a serial connection to the device and enter the REPL
  2. Run the following
    from adafruit_macropad import MacroPad
    m = MacroPad()
    m.display_sleep = True
  3. Watch the display enter sleep mode
  4. Hit Ctrl + D to trigger a soft reboot and enter the REPL again

Expectation

The display wakes up again.

Actual result

The display is still in sleep mode and

>>> from adafruit_macropad import MacroPad
>>> m = MacroPad()
>>> m.display_sleep
False

Workaround

It is still possible to wake up the display manually by always calling

from adafruit_macropad import MacroPad
m = MacroPad()
m.display_sleep = True
m.display_sleep = True

at the beginning of your code. But this is rather ugly because the property needs to be changed twice.

Proposed solution

I did not found a way to query the displays sleep state in the manual. However sending the wake command multiple times to the display seems to have no side effect. Therefore I propose sending the wake command during the initialization of the MacroPad class to ensure the state of the display.

I will provide a pull request for the proposed solution.

kalehmann added a commit to kalehmann/Adafruit_CircuitPython_MacroPad that referenced this issue May 2, 2023
ladyada added a commit that referenced this issue May 3, 2023
Resolve #45: Ensure the display is awake after initialization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant
0