-
-
Notifications
You must be signed in to change notification settings - Fork 938
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
Improve sleep time #648
Improve sleep time #648
Conversation
I like these changes they definitely feel more appropriate. |
src/displayapp/DisplayApp.h
Outdated
@@ -44,8 +44,7 @@ namespace Pinetime { | |||
enum class States { Idle, Running }; | |||
enum class FullRefreshDirections { None, Up, Down, Left, Right, LeftAnim, RightAnim }; | |||
|
|||
DisplayApp(Drivers::St7789& lcd, | |||
Components::LittleVgl& lvgl, | |||
DisplayApp(Components::LittleVgl& lvgl, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't Drivers::St7789& lcd
also be removed from https://github.com/JF002/InfiniTime/blob/develop/src/displayapp/DisplayAppRecovery.h#L45 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lcd is actually used in DisplayAppRecovery, but it looks like DisplayApp and DisplayAppRecovery must use all the same parameters even if they aren't needed. I would like to improve this as well, but for now I'll just put lcd back in DisplayApp even though it isn't used, just to keep this PR simple.
Work fine. I've tested it for a few minutes together with my lcd wakeup optimizations and yours better button handler. I did not noticed any issues sleeping or when pressing button many times. |
any news on reviewing this @geekbozu ? |
I want to do a comparison on battery draw given these changes still. Life has been busy, PR is in my todo list to review/data log :) |
Squashed commit of the following: commit d213ae7 Author: Riku Isokoski <[email protected]> Date: Mon Sep 20 11:38:33 2021 +0300 Fix DisplayAppRecovery commit de7cc1f Merge: a825fcb 5855906 Author: Riku Isokoski <[email protected]> Date: Sat Sep 18 19:19:03 2021 +0300 Merge branch 'develop' into del_dispapp_lcd commit a825fcb Author: Riku Isokoski <[email protected]> Date: Mon Sep 6 11:59:54 2021 +0300 Remove lcd from DisplayApp
The datasheet does not provide much details about DISPLAY ON and OFF modes, unfortunately, except that the display is in DISPLAY OFF mode after reset/sleep. IIRC, I wrote the display driver with the help of other community member at that time, and maybe by reading the sources of other similar driver found online. So I might have copied that displayon/off command just to be sure the display will work properly. If there's no visible side effect of that command, let's remove it and spare 500ms each time the display goes to sleep :) |
DisplayOn() and DisplayOff() are direct lcd commands, it's better to use only Sleep() and Wakeup().
The lcd is already controlled in SystemTask, so these aren't necessary in DisplayApp. SleepIn() puts the lcd into the lowest power mode so DisplayOff() doesn't do anything as far as I can tell.
EDIT: lcd can't be removed from DisplayApp, because DisplayAppRecovery needs it, and DisplayAppRecovery also has a lot of unused parameters. I'll look at this separately.
This eliminates the mysterious 500ms delay that exists in DisplayOff(). https://github.com/JF002/InfiniTime/blob/6f9f0e8b0e42a5526d47ca664534fb6b0ccb6ace/src/drivers/St7789.cpp#L119