Fix ota, use MMU to determine running partition, use RMW wrapper for ota_data partition (littelfs handles this internally, so it was no problem prior)

This commit is contained in:
2026-03-18 01:22:33 +01:00
parent 66e1fe63e0
commit 39e4e733f3
11 changed files with 220 additions and 249 deletions

View File

@@ -52,6 +52,7 @@ pub enum FatError {
SpawnError {
error: SpawnError,
},
OTAError,
PartitionError {
error: esp_bootloader_esp_idf::partitions::Error,
},
@@ -106,6 +107,9 @@ impl fmt::Display for FatError {
}
FatError::SNTPError { error } => write!(f, "SNTPError {error:?}"),
FatError::BMSError { error } => write!(f, "BMSError, {error}"),
FatError::OTAError => {
write!(f, "OTA missing partition")
}
}
}
}
@@ -323,13 +327,12 @@ impl From<sntpc::Error> for FatError {
}
}
impl From<BmsProtocolError> for FatError{
impl From<BmsProtocolError> for FatError {
fn from(value: BmsProtocolError) -> Self {
match value {
BmsProtocolError::I2cCommunicationError => {
FatError::String{error: "I2C communication error".to_string()}
}
BmsProtocolError::I2cCommunicationError => FatError::String {
error: "I2C communication error".to_string(),
},
}
}
}
}