Skip to content

Commit

Permalink
feat(bench): enable more benchmarks (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 authored Oct 9, 2024
2 parents e32d9ba + 44ac8f9 commit 7d27259
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/riot-rs-bench/src/cortexm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use cortex_m::{
use crate::Error;

#[allow(missing_docs)]
pub fn benchmark<F: Fn() -> ()>(iterations: usize, f: F) -> Result<usize, Error> {
pub fn benchmark<F: FnMut() -> ()>(iterations: usize, mut f: F) -> Result<usize, Error> {
let mut p = unsafe { Peripherals::steal() };
//
p.SCB.clear_sleepdeep();
Expand Down
2 changes: 1 addition & 1 deletion src/riot-rs-bench/src/esp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use esp_hal::{
use crate::Error;

#[allow(missing_docs)]
pub fn benchmark<F: Fn() -> ()>(iterations: usize, f: F) -> Result<usize, Error> {
pub fn benchmark<F: FnMut() -> ()>(iterations: usize, mut f: F) -> Result<usize, Error> {
let mut systimer_periph = unsafe { peripherals::SYSTIMER::steal() };
let timer = SystemTimer::new(&mut systimer_periph);

Expand Down
2 changes: 1 addition & 1 deletion src/riot-rs-bench/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cfg_if::cfg_if! {
/// Returns [`Error::SystemTimerWrapped`] if the system timer counter has wrapped when
/// benchmarking.
#[allow(unused_variables)]
pub fn benchmark<F: Fn()>(iterations: usize, f: F) -> Result<usize, Error> {
pub fn benchmark<F: FnMut()>(iterations: usize, f: F) -> Result<usize, Error> {
unimplemented!();
}
}
Expand Down

0 comments on commit 7d27259

Please sign in to comment.