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

Improve marker functionality and related dumpfile issues #179

Merged
merged 9 commits into from
Nov 18, 2024
Merged

Conversation

loostrum
Copy link
Member

@loostrum loostrum commented Nov 15, 2024

Updates in host library:

  • Avoid segfaults by avoiding writing when a dumpfile no longer exists
  • Wait for markers to finish writing when 1. Stopping a dump, 2. stopping the IO thread.
  • Remove unused extended mark function that does not sync with device

The default timeout when waiting for markers is 500 ms. Still, sometimes the last marker is not written. Even with a 5s timeout this happens. To be debugged further in firmware: verify the marker is actually being sent. Perhaps the boolean flag in the firmware (should we send a marker?) can be replaced by a counter to avoid missing markers in quick succession.

Firmware updates:

  • Count how many markers should still be sent, instead of using a boolean. This avoids missing a second marker when request very close in time to the first one.
  • When receiving a stop signal (T or X), first wait for any markers to be sent

Use this to wait for any writing of markers to finish. Used when the dumping to file is stopped,
and when the I/O thread is stopped. Sometimes a marker was written after
closing the dump file. Check if the dumpfile is not nullptr both when
writing a marker and when writing power data
host/src/PowerSensor.cc Outdated Show resolved Hide resolved
The device now keeps track of markers to send with a counter instead of boolean
When a second marker request is received before the first one is sent, both are now sent
with consecutive samples of sensor 0
First wait for all markers to be processed, then wait for final packet to be
sent to avoid missing last marker
@loostrum loostrum marked this pull request as ready for review November 18, 2024 11:16
This was linked to issues Nov 18, 2024
@loostrum loostrum merged commit 196a55c into main Nov 18, 2024
11 checks passed
@loostrum loostrum deleted the 177-markers branch November 18, 2024 12:13
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.

Issues with markers Update marker functions
1 participant