Repository navigation
Version 0.2.0 - #18
Merged
Merged
Conversation
feat: implemented callback for tick getting
feat: implemented callback for tick getting in tasks module
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
Prepare the next release (v0.2.0) of libtimebase-sw by merging
devintomaster.The main goal is to remove the
current_tickparameter from the tasks and watchdogs APIs:both modules now read the time through a user-provided tick getter. The PR also fixes several
scheduling bugs in the tasks module and extends the watchdogs API.
Overview
Tick getter (breaking)
tasks_api_initandwatchdogs_api_init_poolnow take auint32_t (*)(void)tick getter(
task_tick_callback/watchdog_tick_callback) instead ofcurrent_tick.current_tickhas been removed from*_routine,tasks_api_enable/pause/disable/update_taskand
watchdogs_api_watchdog_start/restart/pet.timebase_get_tickwrapper, the HAL tick or the RTOS tick).The temporal continuity check still applies to the value the getter returns.
Tasks
(next trigger, remaining repeats) is updated before the callback runs.
skipped and counted, and the count can be read with the new
tasks_api_get_dropped_task_executions().instead of having its schedule recomputed incorrectly.
tasks_api_initandtasks_api_routinenow report heap insertion failures (TASKS_RC_ERROR).MAX_TASKSwas renamed toTASKS_MAX_COUNTand can be overridden at compile time (#ifndefguard).Watchdogs
watchdogs_api_watchdog_reset()puts a watchdog back inNOT_RUNNINGfrom any state,without running its callback.
watchdogs_api_watchdog_feed()signals liveness: a running watchdog is petted, a timed-outwatchdog is restarted, and a stopped watchdog stays stopped.
timeout_callbackwas renamed towatchdog_timeout_callback.MAX_WATCHDOGSwas renamed toWATCHDOGS_MAX_COUNTand can be overridden at compile time.watchdog_module_enabled/task_module_enabledfields were removed from the handlers.Docs, examples, tests
overdue bursts, pause/resume, reset and feed.
Guidance
include/tasks/tasks.h→include/tasks/tasks-api.h→include/watchdogs/watchdogs.h→include/watchdogs/watchdogs-api.h.src/tasks-api.c, the most delicate part. Focus ontasks_api_routine(state update beforethe callback, overdue-drop loop) and
prv_handle_task_transition(resume from paused-and-overdue).src/watchdogs-api.c: the tick getter integration and the newreset/feedfunctions.test/test_tasks/,test/test_watchdog/), to check the edge cases above are covered.README.md,examples/,library.json: check that the docs and examples match the new API.