From 9e814f2a2ffd64e8130c0b8a30ae7a01e65f8ff6 Mon Sep 17 00:00:00 2001 From: Baptiste Wicht Date: Wed, 10 Aug 2016 19:55:18 +0200 Subject: [PATCH] Remove the ticks counter --- kernel/include/timer.hpp | 5 ----- kernel/src/timer.cpp | 19 +++---------------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/kernel/include/timer.hpp b/kernel/include/timer.hpp index 355d2087..1a088f82 100644 --- a/kernel/include/timer.hpp +++ b/kernel/include/timer.hpp @@ -17,11 +17,6 @@ namespace timer { */ void install(); -/*! - * \brief Returns a up-counter in timer ticks - */ -uint64_t ticks(); - /*! * \brief Returns a up-counter in seconds */ diff --git a/kernel/src/timer.cpp b/kernel/src/timer.cpp index d5c6eb3d..138dd319 100644 --- a/kernel/src/timer.cpp +++ b/kernel/src/timer.cpp @@ -58,29 +58,16 @@ void timer::install(){ } void timer::tick(){ - ++_timer_ticks; - + // Simply let the scheduler know about the tick scheduler::tick(); - - if(_timer_ticks % timer_frequency() == 0){ - ++_timer_seconds; - } - - if(_timer_ticks % (timer_frequency() / 1000) == 0){ - ++_timer_milliseconds; - } -} - -uint64_t timer::ticks(){ - return _timer_ticks; } uint64_t timer::seconds(){ - return _timer_seconds; + return counter() / counter_frequency(); } uint64_t timer::milliseconds(){ - return _timer_milliseconds; + return counter() / (counter_frequency() / 1000); } uint64_t timer::timer_frequency(){