From 12560ba1ca4f19910b24b494cfe14ed24840a132 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Thu, 21 May 2026 12:11:56 -0400 Subject: [PATCH 1/2] Introduce extension trait for attaching This saves some steps for humility as a library --- humility-probes-core/src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/humility-probes-core/src/lib.rs b/humility-probes-core/src/lib.rs index 89ca2e881..e813cfeac 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(&self, probe: &str) -> Result>; +} + +impl HubrisAttach for humility::hubris::HubrisArchive { + fn attach(&self, probe: &str) -> Result> { + attach_to_chip(probe, self.chip().as_deref(), None) + } +} From f1561912c8758feb89df0000fb02f5907f08f8bf Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Thu, 21 May 2026 15:04:12 -0400 Subject: [PATCH 2/2] change the name --- humility-probes-core/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/humility-probes-core/src/lib.rs b/humility-probes-core/src/lib.rs index e813cfeac..da6196298 100644 --- a/humility-probes-core/src/lib.rs +++ b/humility-probes-core/src/lib.rs @@ -232,11 +232,11 @@ pub fn attach_for_flashing( /// to chips. It is encourageed to extend this trait as /// needed to make developer's lives easier. pub trait HubrisAttach { - fn attach(&self, probe: &str) -> Result>; + fn attach_to_chip(&self, probe: &str) -> Result>; } impl HubrisAttach for humility::hubris::HubrisArchive { - fn attach(&self, probe: &str) -> Result> { + fn attach_to_chip(&self, probe: &str) -> Result> { attach_to_chip(probe, self.chip().as_deref(), None) } }