owb_core/utils/mod.rs
1//! Utility re-exports and helper macros for the Omni-Wheel Bot.
2//!
3//! This module re-exports core components, timing, kinematics, and connection
4//! controllers, and provides helper macros and embedded web assets:
5//!
6//! - `connection`: WebSocket server and message handling
7//! - `controllers`: I2C and LED controllers for robotics hardware
8//! - `math`: kinematics calculations for omni-wheel motion
9//! - `frontend`: compressed HTML/CSS/JS assets for the web UI
10//!
11//! The `mk_static!` macro simplifies static initialization in no-std contexts.
12
13pub mod connection;
14pub mod controllers;
15pub(crate) mod frontend;
16pub mod math;
17
18pub use connection::server::run as wss;
19pub use controllers::SystemController;
20pub use embassy_time::*;
21pub use math::kinematics::EmbodiedKinematics as ek;
22
23#[macro_export]
24/// Initialize a no-std static cell and write the given value into it.
25///
26/// This macro creates a `static_cell::StaticCell` for type `$t` and initializes
27/// it with `$val`, returning a mutable reference to the stored value.
28macro_rules! mk_static {
29 ($t:ty, $val:expr) => {{
30 static STATIC_CELL: static_cell::StaticCell<$t> = static_cell::StaticCell::new();
31 STATIC_CELL.uninit().write($val)
32 }};
33}