forked from letscontrolit/ESPEasy
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[issue letscontrolit#914] _P053_PMSx003 Dust Sensor looses sync
- Use peek instead of read, to make sure a complete packet is in the buffer. - Flush buffer after processing a packet. - Increased software serial buffer to the size of 3 packets. - Peek (+ read garbage) 10 times per second to get the buffer in sync to start with start byte of packet. - Decent delete + clean up of software serial allocation when changing settings (prevent memory leak) - Move log String allocation to inside scope of function, not permanent allocated. - Split into separate functions to make it better readable.
- Loading branch information
Showing
1 changed file
with
101 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters