Repository navigation
feat: implemented callback for tick getting in tasks module - #16
Merged
Merged
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose
Add callback to the tasks module to get the tick
Overview
This pull request refactors the tasks API to remove the need for passing the current tick as a parameter to most functions. Instead, the tasks and watchdogs modules now use a user-provided tick getter function, which they call internally whenever they need the current time. This change simplifies the API, makes it easier to use in environments where the current tick isn't always available, and aligns the tasks and watchdogs modules with a consistent approach to time handling. The documentation and example code have been updated to reflect these changes.
API and Usage Refactor:
The tasks module now receives a tick getter function (
uint32_t get_tick(void)) during initialization, which it uses to obtain the current tick internally; all API functions that previously required acurrent_tickparameter no longer take it. (README.md,examples/tasks-example.c) [1] [2] [3] [4] [5] [6] [7]All example code and documentation have been updated to demonstrate the new API, including changes to function signatures and usage patterns in
examples/tasks-example.cand the main setup loop in theREADME.md. [1] [2] [3] [4] [5] [6]Documentation Improvements:
The README now includes a dedicated section explaining the tick getter concept, its requirements, and usage notes, as well as updated descriptions for all relevant API functions and behaviors. (
README.md) [1] [2]All references to time handling, scheduling, and temporal discontinuity in the tasks and watchdogs modules have been revised to clarify that the tick is obtained via the getter function, and to explain the implications for API calls and callbacks. (
README.md) [1] [2] [3]Testing and CI:
unified-example.cexample, ensuring coverage for the updated API. (.github/workflows/main.yml)closes #14