~aleteoryx/muditaos

16c0d166477631784e7e43ac257613aaff943501 — Lukasz Skrzypczak 4 years ago 46b856d
[EGD-3685] Fix timers starting without callback

Fixed null-callback timer in Vibra starting automatically on creation
M module-services/service-evtmgr/vibra/Vibra.cpp => module-services/service-evtmgr/vibra/Vibra.cpp +5 -2
@@ 16,8 16,11 @@ namespace vibra_handle
        vibratorTimerPause =
            std::make_unique<sys::Timer>("VibraPauseTimer", parent, bsp::vibrator::defaultVibraPauseMs);

        vibratorTimerOneshot->setInterval(bsp::vibrator::defaultVibraPulseMs);
        vibratorTimerPause->setInterval(bsp::vibrator::defaultVibraPauseMs);
        vibratorTimerOneshot->connect(nullTimerCallback);
        vibratorTimerPause->connect(nullTimerCallback);

        vibratorTimerOneshot->stop();
        vibratorTimerPause->stop();
    }

    void Vibra::intPulse(bool repetitive)

M module-services/service-evtmgr/vibra/Vibra.hpp => module-services/service-evtmgr/vibra/Vibra.hpp +1 -0
@@ 36,5 36,6 @@ namespace vibra_handle
        int repetitions = 1;

        void intPulse(bool repetitive);
        std::function<void(sys::Timer &)> nullTimerCallback{};
    };
} // namespace vibra_handle