Mark3 Realtime Kernel
timerlist.h
Go to the documentation of this file.
1 /*===========================================================================
2  _____ _____ _____ _____
3  ___| _|__ __|_ |__ __|__ |__ __| __ |__ ______
4 | \ / | || \ || | || |/ / ||___ |
5 | \/ | || \ || \ || \ ||___ |
6 |__/\__/|__|_||__|\__\ __||__|\__\ __||__|\__\ __||______|
7  |_____| |_____| |_____| |_____|
8 
9 --[Mark3 Realtime Platform]--------------------------------------------------
10 
11 Copyright (c) 2012 - 2019 m0slevin, all rights reserved.
12 See license.txt for more information
13 =========================================================================== */
24 #pragma once
25 
26 #include "kerneltypes.h"
27 #include "mark3cfg.h"
28 
29 #include "mutex.h"
30 
31 namespace Mark3
32 {
33 class Timer;
34 
35 //---------------------------------------------------------------------------
40 class TimerList : public TypedDoubleLinkList<Timer>
41 {
42 public:
48  void Init();
49 
56  void Add(Timer* pclListNode_);
57 
64  void Remove(Timer* pclLinkListNode_);
65 
71  void Process();
72 
73 private:
75  uint32_t m_u32NextWakeup;
76 
79 
82 };
83 } // namespace Mark3
the TimerList class. This class implements a doubly-linked-list of timer objects. ...
Definition: timerlist.h:40
void Remove(Timer *pclLinkListNode_)
Remove Remove a timer from the TimerList, cancelling its expiry.
Definition: timerlist.cpp:51
Basic data type primatives used throughout the OS.
uint32_t m_u32NextWakeup
The time (in system clock ticks) of the next wakeup event.
Definition: timerlist.h:75
void Init()
Init Initialize the TimerList object. Must be called before using the object.
Definition: timerlist.cpp:27
Definition: atomic.cpp:23
Mark3 Kernel Configuration This file is used to configure the kernel for your specific application in...
The Mutex Class. Class providing Mutual-exclusion locks, based on BlockingObject. ...
Definition: mutex.h:63
void Process()
Process Process all timers in the timerlist as a result of the timer expiring. This will select a new...
Definition: timerlist.cpp:61
Mutex m_clMutex
Guards against concurrent access to the timer list - Only needed when running threaded.
Definition: timerlist.h:81
Mutual exclusion class declaration Resource locks are implemented using mutual exclusion semaphores (...
The Timer Class. This class provides kernel-managed timers, used to provide high-precision delays...
Definition: timer.h:68
bool m_bTimerActive
Whether or not the timer is active.
Definition: timerlist.h:78
void Add(Timer *pclListNode_)
Add Add a timer to the TimerList.
Definition: timerlist.cpp:35