tanksensor and rtc sync

This commit is contained in:
2025-09-23 22:59:08 +02:00
parent d010c5d12a
commit 5b009f50e5
10 changed files with 116 additions and 102 deletions

View File

@@ -1,13 +1,9 @@
use crate::bail;
use crate::hal::Box;
use crate::FatError::FatResult;
use alloc::vec;
use alloc::vec::Vec;
use async_trait::async_trait;
use bincode::config::Configuration;
use bincode::{config, Decode, Encode};
use chrono::{DateTime, Utc};
use crc::Digest;
use ds323x::ic::DS3231;
use ds323x::interface::I2cInterface;
use ds323x::{DateTimeAccess, Ds323x};
@@ -15,12 +11,11 @@ use eeprom24x::addr_size::TwoBytes;
use eeprom24x::page_size::B32;
use eeprom24x::unique_serial::No;
use embassy_embedded_hal::shared_bus::blocking::i2c::I2cDevice;
use embassy_sync::blocking_mutex::raw::{CriticalSectionRawMutex, NoopRawMutex};
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
use embedded_storage::{ReadStorage, Storage};
use esp_hal::delay::Delay;
use esp_hal::i2c::master::I2c;
use esp_hal::Blocking;
use littlefs2_core::{PathBuf, SeekFrom};
use serde::{Deserialize, Serialize};
pub const X25: crc::Crc<u16> = crc::Crc::<u16>::new(&crc::CRC_16_IBM_SDLC);
@@ -95,7 +90,7 @@ impl RTCModuleInteraction for DS3231Module {
Ok((buf, 0, header.crc16))
} else {
self.storage.read(offset as u32, &mut buf)?;
let data = &buf[..chunk_size];
//&buf[..chunk_size];
Ok((buf, chunk_size, header.crc16))
}
}