Skip to content

Commit

Permalink
Implement heartbeat function in sys crate
Browse files Browse the repository at this point in the history
  • Loading branch information
yogh333 committed Jan 20, 2025
1 parent 83573d8 commit ec33697
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ledger_secure_sdk_sys/src/seph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ pub fn send_general_status() {
}
}

/// Function to ensure a I/O channel is not timeouting waiting
/// for operations after a long time without SEPH packet exchanges
pub fn heartbeat() {
send_general_status();
let mut spi_buffer = [0u8; 128];
seph_recv(&mut spi_buffer, 0);
while is_status_sent() {
seph_recv(&mut spi_buffer, 0);
}
}

#[repr(u8)]
pub enum SephTags {
ScreenDisplayStatus = SEPROXYHAL_TAG_SCREEN_DISPLAY_STATUS as u8,
Expand Down

0 comments on commit ec33697

Please sign in to comment.