Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
feat: controller update rate constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Tropix126 committed Apr 1, 2024
1 parent 81c5495 commit 04741e9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/vex-devices/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//!
//! Controllers are identified by their id, which is either 0 (master) or 1 (partner).
//! State of a controller can be checked by calling [`Controller::state`] which will return a struct with all of the buttons' and joysticks' state.
use core::time::Duration;

use alloc::ffi::CString;

use snafu::Snafu;
Expand Down Expand Up @@ -253,6 +255,9 @@ impl From<ControllerId> for V5_ControllerId {
}

impl Controller {
/// The update rate of the controller.
pub const UPDATE_RATE: Duration = Duration::from_millis(25);

fn validate(&self) -> Result<(), ControllerError> {
if !controller_connected(self.id) {
return Err(ControllerError::NotConnected);
Expand Down

0 comments on commit 04741e9

Please sign in to comment.