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

Commit

Permalink
docs: add more module level documentation + other minor stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin-Niederman committed Dec 24, 2023
1 parent f4b7ace commit 9a310c9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions pros-sys/src/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ pub const COMPETITION_AUTONOMOUS: u8 = 1 << 0;
pub const COMPETITION_DISABLED: u8 = 1 << 1;
pub const COMPETITION_CONNECTED: u8 = 1 << 2;
extern "C" {
/// Get the current status of the competition control.
/// Returns The competition control status as a mask of bits with COMPETITION_{ENABLED,AUTONOMOUS,CONNECTED}.
pub fn competition_get_status() -> u8;
/// Returns true if the robot is in autonomous mode, false otherwise.
pub fn competition_is_autonomous() -> bool;
/// Returns true if the V5 Brain is connected to competition control, false otherwise.
pub fn competition_is_connected() -> bool;
/// Returns true if the V5 Brain is disabled, false otherwise.
pub fn competition_is_disabled() -> bool;
}
// controller
Expand Down
2 changes: 2 additions & 0 deletions pros/src/battery.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Utilites for getting information about the robot's battery.

/// Get the robot's battery capacity.
pub fn get_capacity() -> f64 {
unsafe { pros_sys::misc::battery_get_capacity() }
Expand Down
2 changes: 2 additions & 0 deletions pros/src/competition.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Utilities for getting what state of the competition the robot is in.

/// The current status of the robot, allowing checks to be made
/// for autonomous, disabled, and connected states.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
Expand Down
3 changes: 3 additions & 0 deletions pros/src/controller.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Read from the buttons and joysticks on the controller and write to the controller's display.

use alloc::{ffi::CString, vec::Vec};
use pros_sys::{controller_id_e_t, PROS_ERR};
use snafu::Snafu;
Expand Down Expand Up @@ -40,6 +42,7 @@ pub struct ControllerState {
pub buttons: Buttons,
}

/// Represents one line on the controller console.
pub struct ControllerLine {
controller: Controller,
line: u8,
Expand Down
5 changes: 2 additions & 3 deletions pros/src/task/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! Functions for creation and management of tasks.
//! Tasks are the main way to run code asynchronously.
//!
//!
//! Tasks can be created with the [`spawn`] function or, for more control, with a task [`Builder`].
//! ## Example
//! ```rust
Expand All @@ -9,7 +8,7 @@
//! });
//! ```
//! After a task has been spawned you can manage it with the returned [`TaskHandle`].
//!
//!
//! Task locals can be created with the [`os_task_local!`](crate::os_task_local!) macro.
//! See the [`local`] module for more info.

Expand Down

0 comments on commit 9a310c9

Please sign in to comment.