Skip to content
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

Switch activity LED blinking from delay to polling #478

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

morio
Copy link
Collaborator

@morio morio commented Dec 3, 2024

The purpose behind this change is to stop having USB console logging be jittery because of blinking function when there is no SD card inserted. This was due to the blinking function being delay based. Switched the blink function to polling and checks when blinking should occur with deadlines.

The purpose behind this change is to stop having USB console logging
be jittery because of blinking function when there is no SD card
inserted. This was due to the blinking function being delay based.
Switched the blink function to polling and checks when blinking should
occur with deadline checks.
@aperezbios aperezbios marked this pull request as ready for review December 3, 2024 02:04
@aperezbios aperezbios changed the title Switch blinking from delay to polling Switch activity LED blinking from delay to polling Dec 3, 2024
@PetteriAimonen
Copy link
Collaborator

Seems like a reasonable approach. I think the "led override" functions could use a few comments on what the purpose is and how it works.

This will also cause more frequent reinitialization attempts of the SD card, but I think that shouldn't cause any harm.

A lower effort/impact way to the same goal would be to make the blinking function do something like:

for (int i = 0; i < time/10; i++)
{
   delay(10);
   platform_poll();
}

instead of the plain delay.

@aperezbios
Copy link
Collaborator

Thanks for the feedback, @PetteriAimonen. Merging with updates.

@aperezbios aperezbios merged commit a9d8879 into main Dec 3, 2024
2 checks passed
@aperezbios aperezbios deleted the feature/switch-to-blink-polling branch December 11, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants