diff --git a/humility-probes-core/src/lib.rs b/humility-probes-core/src/lib.rs index 89ca2e881..da6196298 100644 --- a/humility-probes-core/src/lib.rs +++ b/humility-probes-core/src/lib.rs @@ -227,3 +227,16 @@ pub fn attach_for_flashing( ) -> Result> { attach_to_chip(probe, Some(chip), speed_khz) } + +/// Extension trait to make it easier for libraries to attach +/// to chips. It is encourageed to extend this trait as +/// needed to make developer's lives easier. +pub trait HubrisAttach { + fn attach_to_chip(&self, probe: &str) -> Result>; +} + +impl HubrisAttach for humility::hubris::HubrisArchive { + fn attach_to_chip(&self, probe: &str) -> Result> { + attach_to_chip(probe, self.chip().as_deref(), None) + } +}