Skip to content

Commit 8a0f3fa

Browse files
committed
sprot-api: remove ability to return SPI errors
I noticed that sprot-api depended on spi-api, which is otherwise a very STM32-specific crate (for better or worse). This turns out to be only due to the SprotError::Spi variant... which is never constructed, anywhere. So I removed it. This unblocks the upgrade to stm32h7 0.15.
1 parent 5e4f842 commit 8a0f3fa

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

drv/sprot-api/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ counters = { path = "../../lib/counters" }
2323
derive-idol-err = { path = "../../lib/derive-idol-err" }
2424
drv-caboose = { path = "../../drv/caboose" }
2525
drv-lpc55-update-api = { path = "../../drv/lpc55-update-api" }
26-
drv-spi-api = { path = "../../drv/spi-api" }
2726
drv-update-api = { path = "../../drv/update-api" }
2827
dumper-api = { path = "../../task/dumper-api" }
2928
ringbuf = { path = "../../lib/ringbuf" }

drv/sprot-api/src/error.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use attest_api::AttestError;
88
use derive_more::From;
99
use drv_caboose::CabooseError;
1010
use drv_lpc55_update_api::RawCabooseError;
11-
use drv_spi_api::SpiError;
1211
use drv_update_api::UpdateError;
1312
use dumper_api::DumperError;
1413
use hubpack::SerializedSize;
@@ -37,7 +36,6 @@ use idol_runtime::RequestError;
3736
)]
3837
pub enum SprotError {
3938
Protocol(#[count(children)] SprotProtocolError),
40-
Spi(#[count(children)] SpiError),
4139
Update(#[count(children)] UpdateError),
4240
Sprockets(#[count(children)] SprocketsError),
4341
Watchdog(#[count(children)] WatchdogError),
@@ -47,7 +45,6 @@ impl From<SprotError> for SpError {
4745
fn from(value: SprotError) -> Self {
4846
match value {
4947
SprotError::Protocol(e) => Self::Sprot(e.into()),
50-
SprotError::Spi(e) => Self::Spi(e.into()),
5148
SprotError::Update(e) => Self::Update(e.into()),
5249
SprotError::Sprockets(e) => Self::Sprockets(e.into()),
5350
SprotError::Watchdog(e) => Self::Watchdog(e.into()),
@@ -59,7 +56,6 @@ impl From<SprotError> for RotError {
5956
fn from(value: SprotError) -> Self {
6057
match value {
6158
SprotError::Protocol(e) => Self::Sprot(e.into()),
62-
SprotError::Spi(e) => Self::Spi(e.into()),
6359
SprotError::Update(e) => Self::Update(e.into()),
6460
SprotError::Sprockets(e) => Self::Sprockets(e.into()),
6561
SprotError::Watchdog(e) => Self::Watchdog(e.into()),
@@ -345,10 +341,6 @@ impl From<AttestOrSprotError> for AttestDataSprotError {
345341
Self::ProtocolDesynchronized
346342
}
347343
},
348-
SprotError::Spi(e1) => match e1 {
349-
SpiError::BadTransferSize => Self::SpiBadTransferSize,
350-
SpiError::TaskRestarted => Self::SpiTaskRestarted,
351-
},
352344
// We should never return these but it's safer to return an
353345
// enum just in case these come up
354346
SprotError::Update(_) => Self::UpdateError,

0 commit comments

Comments
 (0)