Conditional translation for SYSTEM_TIMER_2 because we want to have posibility to switch between old/new implementation.

Timing functions (millis, micros and delay) replaced in whole source, defined in Marlin.h.
This commit enables original implementation (SYSTEM_TIMER_2 undefined)
Verified with passed complete wizard process.
This commit is contained in:
Robert Pelnar 2019-01-27 22:48:51 +01:00
parent 9a1e914637
commit eea755496b
19 changed files with 320 additions and 264 deletions
Firmware

View file

@ -4,7 +4,7 @@
*/
#include "Timer.h"
#include "Arduino.h"
#include "Marlin.h"
/**
* @brief construct Timer
@ -23,7 +23,7 @@ Timer<T>::Timer() : m_isRunning(false), m_started()
template<typename T>
void Timer<T>::start()
{
m_started = millis();
m_started = _millis();
m_isRunning = true;
}
@ -45,7 +45,7 @@ bool Timer<T>::expired(T msPeriod)
{
if (!m_isRunning) return false;
bool expired = false;
const T now = millis();
const T now = _millis();
if (m_started <= m_started + msPeriod)
{
if ((now >= m_started + msPeriod) || (now < m_started))