Crate pros_core

Source
Expand description

Low level core functionality for pros-rs. The core crate is used in all other crates in the pros-rs ecosystem.

Included in this crate:

  • Global allocator: [pros_alloc]
  • Errno handling: error
  • Serial terminal printing: io
  • No-std Instants: time
  • Synchronization primitives: sync
  • FreeRTOS task management: task

Modules§

allocator
Simple allocator using the VEX libc allocation functions in vexos and jemalloc in the sim.
error
Helpers for dealing with errno.
io
Std-like I/O macros and types for use in pros.
sync
Synchronization types for FreeRTOS tasks.
task
FreeRTOS task creation and management.
time
Temporal quantification.

Macros§

bail_errno
If errno has an error, return early.
bail_on
Checks if the value is equal to the error state, and if it is, uses the value of errno to create an error and return early.
dbg
Prints and returns the value of a given expression for quick and dirty debugging.
eprint
Macro for printing to the standard error.
eprintln
Macro for printing to the standard error, with a newline.
map_errno
Generate an implementation of FromErrno for the given type.
os_task_local
Create new LocalKey(s)
print
Macro for printing to the standard output.
println
Macro for printing to the standard output, with a newline.