Skip to content
This repository was archived by the owner on May 3, 2026. It is now read-only.

♻️ User Competition Functions#65

Merged
liam-teale merged 9 commits into
mainfrom
refactor/user-functions
Jun 6, 2025
Merged

♻️ User Competition Functions#65
liam-teale merged 9 commits into
mainfrom
refactor/user-functions

Conversation

@liam-teale

@liam-teale liam-teale commented Jun 6, 2025

Copy link
Copy Markdown
Member

Overview

  • rewrote system daemon
  • replaced initialize, autonomous, opcontrol, etc with register_driver_control, register_autonomous, and register_disabled
  • rewrote competition state API (e.g pros::c::competition_get_status has been replaced with zest::competition::get_mode)

Motivation

The previous implementation of the system daemon and the user competition functions was very messy.

Implementation Details

  • the old system daemon has been split into 2 tasks: one for executing the user competition functions (max priority - 1, 2ms cycle), another for calling vexTasksRun (max priority, 2ms cycle)
  • callbacks for user competition functions are registered with register_driver_control, register_autonomous, and register_disabled
  • registered callbacks are run only after main returns
  • competition API has its own namespace (zest::competition)

Test Plan:

  • Callbacks are only run after main returns
  • The number of tasks stay the same when switching competition modes
  • Spinlocked competition functions are still killed

@liam-teale liam-teale changed the title Refactor/user functions ♻️ User Competition Functions Jun 6, 2025
@liam-teale liam-teale merged commit 0a6c0e8 into main Jun 6, 2025
2 checks passed
@liam-teale liam-teale deleted the refactor/user-functions branch June 6, 2025 23:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant