split rtc module out to reduce repreated exactly same code

This commit is contained in:
2025-06-24 20:59:12 +02:00
parent e57e87af3f
commit 5fb8705d9a
12 changed files with 318 additions and 416 deletions

View File

@@ -240,14 +240,6 @@ impl Esp<'_> {
println!("Wrote config config {:?}", config);
anyhow::Ok(())
}
pub(crate) fn delete_config(&self) -> anyhow::Result<()> {
let config = Path::new(Self::CONFIG_FILE);
if config.exists() {
println!("Removing config");
fs::remove_file(config)?
}
anyhow::Ok(())
}
pub(crate) fn mount_file_system(&mut self) -> anyhow::Result<()> {
log(LogMessage::MountingFilesystem, 0, 0, "", "");
let base_path = CString::new("/spiffs")?;
@@ -308,10 +300,7 @@ impl Esp<'_> {
OkStd(file) => {
let f = FileInfo {
filename: file.file_name().into_string().unwrap(),
size: file
.metadata()
.map(|it| it.len())
.unwrap_or_default()
size: file.metadata().map(|it| it.len()).unwrap_or_default()
as usize,
};
result.push(f);