-
Notifications
You must be signed in to change notification settings - Fork 1.3k
pusher thread doesn't let CPU sleep #3959
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
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.
Code Review
This pull request refactors the pusher thread to prevent high CPU usage from busy-waiting, replacing k_yield() with k_sleep(). While k_yield() is an acceptable mechanism for preventing busy-waiting (as per repository rules), the new k_sleep() logic introduces a critical data loss bug under certain conditions. My review includes a detailed explanation of the issue and a suggested fix to ensure data integrity while maintaining the power-saving improvement.
|
lgmt @TuEmb |
|
this technique can help devkit/devkit2 too. please create a new ticket |




Related issues #3430 #3151
The
pusherthread was consuming a significant amount of CPU because it was running in a tight super loop, preventing the CPU from entering sleep states. This behavior was a cause of high power consumption.This PR reduces power consumption by approximately 3 mA in both offline and live modes.