Skip to content

Commit

Permalink
feat(bench): enable more benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
elenaf9 committed Oct 9, 2024
1 parent 774c983 commit 44ac8f9
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 44ac8f9

Please sign in to comment.