Revert "new ota logic"

This reverts commit c61a586595.
This commit is contained in:
2026-03-17 22:17:47 +01:00
parent ce981232f0
commit 66e1fe63e0
15 changed files with 401 additions and 314 deletions

View File

@@ -11,7 +11,6 @@ use embedded_storage::nor_flash::NorFlashErrorKind;
use esp_hal::i2c::master::ConfigError;
use esp_hal::pcnt::unit::{InvalidHighLimit, InvalidLowLimit};
use esp_hal::twai::EspTwaiError;
use esp_hal_ota::OtaError;
use esp_radio::wifi::WifiError;
use ina219::errors::{BusVoltageReadError, ShuntVoltageReadError};
use lib_bms_protocol::BmsProtocolError;
@@ -74,9 +73,6 @@ pub enum FatError {
SNTPError {
error: sntpc::Error,
},
OtaError {
error: OtaError,
},
}
pub type FatResult<T> = Result<T, FatError>;
@@ -110,7 +106,6 @@ impl fmt::Display for FatError {
}
FatError::SNTPError { error } => write!(f, "SNTPError {error:?}"),
FatError::BMSError { error } => write!(f, "BMSError, {error}"),
FatError::OtaError { error } => write!(f, "OtaError {error:?}"),
}
}
}
@@ -328,18 +323,13 @@ 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()}
}
}
}
}
impl From<OtaError> for FatError {
fn from(value: OtaError) -> Self {
FatError::OtaError { error: value }
}
}
}