Calls to "Set Screen Brightness" generate a lockup on M5StickC
-
In my app, I want the screen to go off after three seconds, then turn back on for another three seconds when someone presses the button. I accomplished this by using "Set Screen Brightness 0" and "Set Screen Brightness 100" at the appropriate points in the code.
However, if I cycle through this code more than a few times, either the M5StickC or M5StickC+ lockup with screen off. Using the LED for testing, I can tell that they freeze exactly on the "Set Screen Brightness 100" line. There is also erratic behavior in other parts of the code when these lines are implemented.
Take just those two lines of code out, and leave everything else in place, and the program runs just as expected, even when tested over hours. It's definitely this one command that's causing issues.
-
Hello @Devilstower
without the actual UIFlow code it's impossible to give advice. Could you share the minimal UIFlow code which exhibits this issue?
Thanks
Felix -
You really don't need much to demonstrate this issue.
Create a function called "ScreenOff" that contains just the command "Set Screen Brightness 0". Create a second function called "ScreenOn" that contains the command "Set Screen Brightness 100." Try calling them a few times.
I've literally reduced the code to that, where the functions alternate on button A press. It locks up within the first ten calls.
By adding LED On before the screen brightness call, and adding LED Off immediately after, I can see that the LED goes on and stays on when the stick locks up, indicating that it's failing directly on the Set Screen Brightness call. Once the stick is locked, it has to be reset with both side buttons before new code can be loaded.
-
Hello @Devilstower
I cannot reproduce your issue with my M5StickCPlus. I toggled brightness on/off about 100 times without it locking up.
Here is my UIFlow 1.8.7 blockly:Thanks
Felix -
That same code locks up EVERY stick I have. Both M5StickC and M5StickC+. All burned to 1.8.7.
If I take the Screen Brightness calls out, it will run fine. Put the screen brightness calls back in, and I can run it 3-4 times before everything comes to a halt.
-
Hello @Devilstower
that is odd. Have you tried to see what happens if you don't go to full brightness?
Thanks
Felix -
I've tried going to 85. Also changed the minimum to 1. It didn't make a difference. No idea what's going on. One of the sticks gets "streaky" and the screen shows some kind of jumbled pixels before completely locking up, if that provides any sort of clue.
-