Browse Source

utils: SWTimer add time_now to cb params

usb_midi_launchpad
heck 7 months ago
parent
commit
cd3eea4acb
  1. 2
      src/utils.cc
  2. 2
      src/utils.hh

2
src/utils.cc

@ -110,7 +110,7 @@ namespace Heck {
time_last_exec_ = time_now; time_last_exec_ = time_now;
if (callback_) { if (callback_) {
//todo: constexpr if metrics //todo: constexpr if metrics
callback_(); callback_(time_now);
} }
return true; return true;
} }

2
src/utils.hh

@ -16,7 +16,7 @@ namespace Heck {
namespace Heck { namespace Heck {
class SWTimer { class SWTimer {
public: public:
using Callback = std::function<void(void)>; using Callback = std::function<void(u32 time)>;
void set_period(u32 time_units); void set_period(u32 time_units);
void set_callback(const Callback& cb); void set_callback(const Callback& cb);

Loading…
Cancel
Save