fix ota abort/invalid switching

This commit is contained in:
2025-10-06 02:43:37 +02:00
parent 894be7c373
commit a3cdd92af8
11 changed files with 224 additions and 192 deletions

View File

@@ -65,6 +65,9 @@ pub enum FatError {
CanBusError {
error: EspTwaiError,
},
SNTPError {
error: sntpc::Error,
},
}
pub type FatResult<T> = Result<T, FatError>;
@@ -96,6 +99,7 @@ impl fmt::Display for FatError {
FatError::CanBusError { error } => {
write!(f, "CanBusError {:?}", error)
}
FatError::SNTPError { error } => write!(f, "SNTPError {:?}", error),
}
}
}
@@ -299,10 +303,16 @@ impl From<nb::Error<EspTwaiError>> for FatError {
}
}
impl From<NorFlashErrorKind> for FatError{
impl From<NorFlashErrorKind> for FatError {
fn from(value: NorFlashErrorKind) -> Self {
FatError::String {
error: value.to_string()
error: value.to_string(),
}
}
}
impl From<sntpc::Error> for FatError {
fn from(value: sntpc::Error) -> Self {
FatError::SNTPError { error: value }
}
}