This commit is contained in:
Priec
2026-01-19 13:56:39 +01:00
parent 6b26ed9318
commit 424c795170
2 changed files with 6 additions and 9 deletions

View File

@@ -1,4 +1,6 @@
// src/bus/mod.rs // src/bus/mod.rs
//! Shared access to the hardware I2C peripheral on a
//! single core.
use core::cell::RefCell; use core::cell::RefCell;
use embedded_hal_bus::i2c::RefCellDevice; use embedded_hal_bus::i2c::RefCellDevice;

View File

@@ -1,10 +1,9 @@
// src/contracts.rs // src/contracts.rs
//! Cross-feature message contracts. //! Cross-feature message contracts.
//! //!
//! This is the ONLY coupling point between features.
//! Features depend on these types, not on each other. //! Features depend on these types, not on each other.
use heapless::String as HString; use heapless::String;
use pages_tui::input::Key; use pages_tui::input::Key;
/// IMU sensor reading from MPU6050 /// IMU sensor reading from MPU6050
@@ -20,17 +19,13 @@ pub struct ImuReading {
/// Commands that can be sent to the display actor /// Commands that can be sent to the display actor
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub enum DisplayCommand { pub enum DisplayCommand {
/// Show IMU sensor data
SetImu(ImuReading), SetImu(ImuReading),
/// Show a status line (max 32 chars) SetStatus(String<32>),
SetStatus(HString<32>), ShowError(String<64>),
/// Show an error message (max 64 chars)
ShowError(HString<64>),
/// Show MQTT connection status
SetMqttStatus { connected: bool, msg_count: u32 }, SetMqttStatus { connected: bool, msg_count: u32 },
/// Clear the display to default state /// Clear the display to default state
Clear, Clear,
PushKey(Key), PushKey(Key),
AddChatMessage(HString<24>), AddChatMessage(String<24>),
} }