Skip to content

Commit 3f9b1ed

Browse files
committed
use perfect forwarding
1 parent e83119e commit 3f9b1ed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/modm/driver/motion/adns9800.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ class Adns9800 : public adns9800, public modm::SpiDevice<SpiMaster> {
345345
while(not this->acquireMaster()) modm::this_fiber::yield();
346346
Cs::reset();
347347

348-
closure();
349-
348+
std::forward<Callable>(closure)();
349+
350350
ready_to_write.restart(20us); // tSRW: [t]ime [S]pi between [R]rite and [W]rite
351351
ready_to_read.restart(20us); // tSRR: [t]ime [S]pi between [R]rite and [R]ead
352352

@@ -361,7 +361,7 @@ class Adns9800 : public adns9800, public modm::SpiDevice<SpiMaster> {
361361
while(not this->acquireMaster()) modm::this_fiber::yield();
362362
Cs::reset();
363363

364-
closure();
364+
std::forward<Callable>(closure)();
365365

366366
ready_to_write.restart(20us); // tSWW [t]ime [S]pi between [W]rite and [W]rite
367367
ready_to_read.restart(120us); // tSWR [t]ime [S]pi between [W]rite and [R]ead

0 commit comments

Comments
 (0)