We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd21972 commit d27fa67Copy full SHA for d27fa67
ledger_device_sdk/src/io.rs
@@ -451,14 +451,14 @@ impl Comm {
451
T: TryFrom<ApduHeader>,
452
Reply: From<<T as TryFrom<ApduHeader>>::Error>,
453
{
454
- let _: Option<Event<T>> = self.decode_event(spi_buffer);
455
-
456
- if unsafe { G_io_app.apdu_state } != APDU_IDLE && unsafe { G_io_app.apdu_length } > 0 {
457
- self.rx = unsafe { G_io_app.apdu_length as usize };
458
- self.event_pending = true;
459
- return true;
+ match self.decode_event::<T>(spi_buffer) {
+ Some(Event::Command(_)) => {
+ self.rx = unsafe { G_io_app.apdu_length as usize };
+ self.event_pending = true;
+ return true;
+ }
460
+ _ => return false,
461
}
- false
462
463
464
/// Wait for the next Command event. Discards received button events.
0 commit comments