Prevent OTA progress events from blocking system thread #2741
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Emitting a firmware update progress event blocks the system thread if the event queue of the application thread is full.
Solution
Introduce a flag for
system_notify_event()
that allows the system to drop the event if the event queue is full.This PR also removes the unused event queue implementation based on the
cpp::channel
library. Interestingly, that seems to have caused a problem when linking the wiring library with a user app that usesPrint::print(double)
in my local environment even though it's not reproducible on the CI. As a workaround, I inlined methods that get conditionally compiled based on thePARTICLE_WIRING_PRINT_NO_FLOAT
macro since we only build the wiring library once and can't have different compile time options for it depending on where it's used.Steps to Test
Test Application
References