Skip to content

Display sleep mode persists after soft reboot #45

Closed
@kalehmann

Description

@kalehmann

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions