split into hardware dependent / independent
This commit is contained in:
45
gem-remotes-lib/src/lib.rs
Normal file
45
gem-remotes-lib/src/lib.rs
Normal file
@ -0,0 +1,45 @@
|
||||
|
||||
/// Business logic (independent of hardware) for Gem Remotes ESP32 controller
|
||||
|
||||
// Modules in this crate
|
||||
pub mod commands;
|
||||
pub mod dispatch;
|
||||
pub mod motor_controller;
|
||||
|
||||
// Re-published items
|
||||
pub use commands::{
|
||||
Button,
|
||||
Commands
|
||||
};
|
||||
pub use motor_controller::{
|
||||
AutoMode,
|
||||
Controller,
|
||||
LimitState,
|
||||
MotorCommands,
|
||||
MotorRecvQ,
|
||||
MotorSendQ,
|
||||
};
|
||||
pub use dispatch::{
|
||||
Dispatch,
|
||||
DispatchSendQ,
|
||||
DispatchRecvQ,
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Test Code for whole module
|
||||
|
||||
pub fn add(left: u64, right: u64) -> u64 {
|
||||
left + right
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
let result = add(2, 2);
|
||||
assert_eq!(result, 4);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user