diff --git a/fan-controller/src/fan.rs b/fan-controller/src/fan.rs index 23f5d56..6a5d829 100644 --- a/fan-controller/src/fan.rs +++ b/fan-controller/src/fan.rs @@ -64,12 +64,12 @@ pub(super) mod holding_registers { pub(crate) const REFERENCE_SET_POINT: [u8; 2] = 0xd001_u16.to_be_bytes(); } -pub(crate) struct FanClient<'a, UART: uart::Instance, PIN: Pin> { +pub(crate) struct Client<'a, UART: uart::Instance, PIN: Pin> { uart: Uart<'a, UART, Async>, driver_enable: Output<'a, PIN>, } -impl<'a, UART: uart::Instance, PIN: Pin> FanClient<'a, UART, PIN> { +impl<'a, UART: uart::Instance, PIN: Pin> Client<'a, UART, PIN> { pub(crate) fn new( uart: impl Peripheral

+ 'a, tx: impl Peripheral

> + 'a, diff --git a/fan-controller/src/main.rs b/fan-controller/src/main.rs index 3140efc..23e074e 100644 --- a/fan-controller/src/main.rs +++ b/fan-controller/src/main.rs @@ -56,7 +56,7 @@ use crate::mqtt::subscribe_acknowledgement::SubscribeAcknowledgement; use crate::mqtt::task::{send, Encode}; use crate::mqtt::QualityOfService; use crate::mqtt::{connect, publish, subscribe}; -use fan::{FanClient, FanSetting}; +use fan::FanSetting; mod async_callback; mod configuration; @@ -908,7 +908,7 @@ async fn input_task(pin_18: PIN_18) { } } -type Fans = Mutex>>; +type Fans = Mutex>>; /// Use this to make calls to the fans through modbus static FANS: Fans = Mutex::new(None); #[embassy_executor::main] @@ -932,7 +932,7 @@ async fn main(spawner: Spawner) { // UART - let client = FanClient::new(uart0, pin_12, pin_13, Irqs, dma_ch1, dma_ch2, pin_4); + let client = fan::Client::new(uart0, pin_12, pin_13, Irqs, dma_ch1, dma_ch2, pin_4); // Inner scope to drop the guard after assigning { *(FANS.lock().await) = Some(client);