#include "Timer.hpp"

using namespace HomieInternals;

Timer::Timer()
: _initialTime(0)
, _interval(0)
, _tickAtBeginning(false) {
}

void Timer::setInterval(uint32_t interval, bool tickAtBeginning) {
  _interval = interval;
  _tickAtBeginning = tickAtBeginning;

  this->reset();
}

bool Timer::check() const {
  if (_tickAtBeginning && _initialTime == 0) return true;
  if (millis() - _initialTime >= _interval) return true;

  return false;
}

void Timer::reset() {
  if (tickAtBeginning) {
    _initialTime = 0;
  } else {
    this->tick();
  }
}

void Timer::tick() {
  _initialTime = millis();
}

#include "Timer.hpp"

using namespace HomieInternals;

Timer::Timer()
: _initialTime(0)
, _interval(0)
, _tickAtBeginning(false) {
}

void Timer::setInterval(uint32_t interval, bool tickAtBeginning) {
  _interval = interval;
  _tickAtBeginning = tickAtBeginning;

  this->reset();
}

bool Timer::check() const {
  if (_tickAtBeginning && _initialTime == 0) return true;
  if (millis() - _initialTime >= _interval) return true;

  return false;
}

void Timer::reset() {
  if (_tickAtBeginning) {
    _initialTime = 0;
  } else {
    this->tick();
  }
}

void Timer::tick() {
  _initialTime = millis();
}

Add missing underscore - fix last commit
:bug: Add missing underscore - fix last commit
