Skip to content

Conversation

@SizzinSeal
Copy link
Member

@SizzinSeal SizzinSeal commented Jun 6, 2025

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants