-
-
Notifications
You must be signed in to change notification settings - Fork 75
Report flashing size using probe-rs's FlashProgress system. #281
Conversation
We get an Initialized object at the start, and then one message per sector erase and one message per block write.
let fp = flashing::FlashProgress::new(|evt| { | ||
match evt { | ||
// The flash layout has been built and the flashing procedure was initialized. | ||
flashing::ProgressEvent::Initialized { flash_layout, .. } => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlashLayout
is not part of probe-rs' public API, are you sure we're supposed to use that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what sense is it not public? It's documented in https://docs.rs/probe-rs/0.11.0/probe_rs/flashing/enum.ProgressEvent.html#variant.Initialized.field.flash_layout as
The layout of the flash contents as it will be used by the flash procedure. This is an exact report of what the flashing procedure will do during the flashing process.
It's also the only field in ProgressEvent::Initialized
so it seems like it's OK to use it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but the type isn't documented, and you're calling methods on it which also aren't documented
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll raise a ticket on probe-rs and check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spoke with @Dirbaio on Matrix, and basically it's now de-facto public API. They would like to replace it with something nicer (i.e. simpler) but that will be a breaking-change version bump, so we are safe to rely on this as long as we are on probe-rs 0.11.
bors r+ |
Build succeeded: |
We get an Initialized object at the start, and then one message per sector erase and one message per block write.