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

Update Timer and Task Implementation and add some new example / tests. #127

Merged
merged 5 commits into from
Nov 14, 2023

Conversation

finger563
Copy link
Contributor

@finger563 finger563 commented Nov 14, 2023

Description

  • Update task to join the thread on start if it is joinable (e.g. if it has requested cancellation from within the task function but cancel has not been called).
  • Updated task example to test restarting task without calling cancel.
  • Updated timer to create separate name for the underlying task logger to distinguish between the timer logger and its task logger. Also updated the task logger to use the same logger verbosity / level as the timer.
  • Updated timer to use cv.wait_until instead of cv.wait_for for first run delay
  • Updated checks to use the _float variables instead of checking on the .count() variables.

Motivation and Context

Helps with ensuring timers and tasks can be restarted without needing to first call cancel and helps with managing debugging of tasks / timers.

How has this been tested?

Building and running the task and timer examples.

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

Task example:
CleanShot 2023-11-14 at 15 45 53

Timer example:
CleanShot 2023-11-14 at 15 36 07

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

@finger563 finger563 added bug Something isn't working tasks timer labels Nov 14, 2023
@finger563 finger563 self-assigned this Nov 14, 2023
@finger563 finger563 merged commit 56f2eee into main Nov 14, 2023
47 checks passed
@finger563 finger563 deleted the fix/timer branch November 14, 2023 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tasks timer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant