use thiserror for protocol error type
This commit is contained in:
Generated
+1
@@ -537,6 +537,7 @@ name = "lib-bms-protocol"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"embedded-hal 1.0.0",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -5,6 +5,7 @@ edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
embedded-hal = "1.0.0"
|
||||
thiserror = { version = "2.0.17", default-features = false }
|
||||
|
||||
|
||||
[profile.dev]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#![no_std]
|
||||
|
||||
use embedded_hal::i2c::{I2c, Operation, SevenBitAddress};
|
||||
use thiserror::Error;
|
||||
|
||||
pub const BMS_I2C_ADDRESS: u8 = 0x55;
|
||||
|
||||
@@ -17,7 +18,9 @@ pub trait BmsWriteable {
|
||||
I: I2c<SevenBitAddress>;
|
||||
}
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum BmsProtocolError {
|
||||
#[error("i2c communication failed")]
|
||||
I2cCommunicationError,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user