split into hardware dependent / independent

This commit is contained in:
2024-08-30 23:16:31 -04:00
parent 4d8a2970c4
commit aa1d4a9371
14 changed files with 142 additions and 69 deletions

View 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);
}
}