subsys/cron: move the cron scheduler out of services - #2100
Merged
Merged
Conversation
jplexer
approved these changes
Sep 17, 2026
gmarull
force-pushed
the
cron-subsys
branch
from
September 18, 2026 07:58
c198ef9 to
b3de1ca
Compare
The wall-clock job scheduler has no firmware-specific state and is used by activity, alarms and the timeline peek, so it belongs with the other OS subsystems. src/fw/services/cron becomes subsys/cron, the job API (<pebbleos/cron.h>) and the control API (pbl/services/cron.h) collapse into a single <pbl/cron/cron.h>, and the whole surface takes the pbl namespace: struct pbl_cron_job, pbl_cron_job_cb_t, pbl_cron_job_*(), pbl_cron_init(), pbl_cron_handle_clock_change() and the PBL_CRON_*_ANY and PBL_CRON_WDAY_* selectors. CONFIG_SERVICE_CRON becomes CONFIG_CRON and the log module is now "cron". pbl_cron_handle_clock_change() takes the UTC delta, GMT offset delta and DST flag directly instead of a PebbleSetTimeEvent, so the subsystem no longer includes kernel/events.h. The old header declared cron_job_schedule_after(new_job, job) while the implementation and its only caller used (job, new_job); the header now matches the implementation. Verified with the full unit test suite and an asterix build. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
gmarull
force-pushed
the
cron-subsys
branch
from
September 18, 2026 08:00
b3de1ca to
62c64f7
Compare
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.
Summary
src/fw/services/crontosubsys/cron, alongside logging.<pebbleos/cron.h>) and control API (pbl/services/cron.h) into a single<pbl/cron/cron.h>, fullypbl-namespaced:struct pbl_cron_job,pbl_cron_job_cb_t,pbl_cron_job_*(),pbl_cron_init(),pbl_cron_handle_clock_change(),PBL_CRON_*_ANYandPBL_CRON_WDAY_*.CONFIG_SERVICE_CRONbecomesCONFIG_CRON(log modulecron).pbl_cron_handle_clock_change()takes the UTC delta, GMT offset delta and DST flag directly instead of aPebbleSetTimeEvent, so the subsystem no longer depends onkernel/events.h.cron_job_schedule_after(new_job, job)while the implementation and its only caller used(job, new_job); the header now matches the implementation. No behaviour change.Test plan
.configshowsCONFIG_CRON=ywith the log-level symbols generated🤖 Generated with Claude Code