Skip to content

Commit

Permalink
Export C function to rust for calling heart_beat
Browse files Browse the repository at this point in the history
  • Loading branch information
neithanmo committed Mar 15, 2024
1 parent 07d800e commit 89b120f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,12 @@ fn debug(_msg: &str) {}
fn panic(_info: &PanicInfo) -> ! {
loop {}
}

extern "C" {
fn io_heart_beat();
}

// Lets the device breath between computations
pub(crate) fn heart_beat() {
unsafe { io_heart_beat() }
}
4 changes: 4 additions & 0 deletions app/src/c_api/rust.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,7 @@ void c_jubjub_spending_base_scalarmult(uint8_t *point, const uint8_t *scalar) {
MEMZERO(point, JUBJUB_FIELD_BYTES);
}
}

void io_heart_beat() {
io_seproxyhal_io_heartbeat();
}

0 comments on commit 89b120f

Please sign in to comment.