-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Added Smooth Sleep and Fixed BLE SourApple Payload #1487
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
base: dev
Are you sure you want to change the base?
Conversation
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.
Just a few missing check for the device LED.
Since Bruce also targets devices with small flash for optimisation reasons as much code as possible needs to be removed when not required for all devices.
For example there are still variables being defined to calculate LED dimming, this are not needed when the device is not using LEDs.
Final step would be to change the functions to not have start/endLed when not on an LED device.
fadeAll(int startDisp, int startLed, int endDisp, int endLed);
It might be worth when you have made these change to try and compile locally for the M5 Stick which does not have LEDs to check it still compiles with no errors.
src/core/powerSave.cpp
Outdated
// Forward declaration | ||
static void fadeAll(int startDisp, int startLed, int endDisp, int endLed); |
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.
This should be in the powerSave.h
src/core/powerSave.cpp
Outdated
if (elapsed >= (unsigned long)fadeDuration) { | ||
// final state | ||
setBrightness(fadeEndDisp, false); | ||
setLedBrightness(fadeEndLed); |
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.
Missed checking if device has LED.
|
||
if (fadingIn) { | ||
// After wake‑up fade completes: | ||
ledSetup(); |
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.
Missed checking if device has LED.
src/core/powerSave.cpp
Outdated
int d = fadeStartDisp + int((fadeEndDisp - fadeStartDisp) * t); | ||
int l = fadeStartLed + int((fadeEndLed - fadeStartLed) * t); | ||
setBrightness(d, false); | ||
setLedBrightness(l); |
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.
Missed checking if device has LED.
#ifdef HAS_RGB_LED | ||
setLedBrightness(bruceConfig.ledBright); | ||
#endif | ||
ledSetup(); |
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.
Missed checking if device has LED.
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.
Theres problems in the new commit. Im sorry about that just dont use github that often. I will work on it when i get home, im also working on the config menu as u can see. But i commited everything on accident. When i get home ill fix everything. Sorry again.
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.
Everthing is good and i also cleaned up the menus
No need to apologise.. We have all the time in the Sharky world.... What is
important is the end results i suppose.. 😉
…On Thu, Jul 17, 2025 at 2:25 PM NVR ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/core/powerSave.cpp
<#1487 (comment)>:
> - feedLoopWDT();
- delay(200);
+ // Wake panel hardware (doesn't change brightness)
+ panelSleep(false);
+
+ // Clear flags now so checkPowerSaveTime can start a new cycle
+ dimmer = false;
+ isScreenOff = false;
+
+ if (!fade || !bruceConfig.smoothSleep) {
+ // Instant restore
+ setBrightness(bruceConfig.bright, false);
+#ifdef HAS_RGB_LED
+ setLedBrightness(bruceConfig.ledBright);
+#endif
+ ledSetup();
Theres problems in the new commit. Im sorry about that just dont use
github that often. I will work on it when i get home, im also working on
the config menu as u can see. But i commited everything on accident. When i
get home ill fix everything. Sorry again.
—
Reply to this email directly, view it on GitHub
<#1487 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BLDL6BSDJVRATTPZXIZNS3D3I6I3LAVCNFSM6AAAAACBUUQY2SVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTAMRZGMYDGOJQGQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
Kind Regards
C.R
May Prosperity allways be with us!!
|
When i walk into a building..... I want them to notice me..... Know what im
saying.... =) So i want apple, sour and creamy juice for my Bruce... And it
need to be a part of Spam all... Of course....
On Thu, Jul 17, 2025 at 6:13 PM Christian Roth. ***@***.***>
wrote:
… No need to apologise.. We have all the time in the Sharky world.... What
is important is the end results i suppose.. 😉
On Thu, Jul 17, 2025 at 2:25 PM NVR ***@***.***> wrote:
> ***@***.**** commented on this pull request.
> ------------------------------
>
> In src/core/powerSave.cpp
> <#1487 (comment)>:
>
> > - feedLoopWDT();
> - delay(200);
> + // Wake panel hardware (doesn't change brightness)
> + panelSleep(false);
> +
> + // Clear flags now so checkPowerSaveTime can start a new cycle
> + dimmer = false;
> + isScreenOff = false;
> +
> + if (!fade || !bruceConfig.smoothSleep) {
> + // Instant restore
> + setBrightness(bruceConfig.bright, false);
> +#ifdef HAS_RGB_LED
> + setLedBrightness(bruceConfig.ledBright);
> +#endif
> + ledSetup();
>
> Theres problems in the new commit. Im sorry about that just dont use
> github that often. I will work on it when i get home, im also working on
> the config menu as u can see. But i commited everything on accident. When i
> get home ill fix everything. Sorry again.
>
> —
> Reply to this email directly, view it on GitHub
> <#1487 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/BLDL6BSDJVRATTPZXIZNS3D3I6I3LAVCNFSM6AAAAACBUUQY2SVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTAMRZGMYDGOJQGQ>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
--
Kind Regards
C.R
May Prosperity allways be with us!!
--
Kind Regards
C.R
May Prosperity allways be with us!!
|
Why did you removed a lot of comments? |
with your changes, the BLE Spams are still working? |
I did tested and seems not working like before, but we need more devices to test since updated devices, have updated security patches. |
Move it to the "dev" brench |
yes they do, i basically fixed the payload mismatch and i believe i optimized it a little (im not sure since i havent worked on my t embed since i made the last changes to this request) |
done, just please check the conflict's and notify me if i merged something the wrong way. |
BLESpam
Fixed the ble_spam.cpp file. It was using the wrong payload (AppleJuice) for SourApple.
Visual Updates
Added a smooth sleep and dim where you can turn it on and off in the config.