Prusa-MMU-Private
PrusaMultiMaterialUpgradev3firmwareforMK3SMK4
timebase.h
Go to the documentation of this file.
1 #pragma once
3 #include <stdint.h>
4 
5 namespace modules {
6 
8 namespace time {
9 
13 class Timebase {
14 public:
15  constexpr inline Timebase()
16  : ms(0) {}
17 
19  void Init();
20 
23  uint16_t Millis() const;
24 
25  void Isr();
26 
29  bool Elapsed(uint16_t start, uint16_t timeout) const;
30 
31 private:
32  uint16_t ms;
33 };
34 
36 extern Timebase timebase;
37 
38 } // namespace time
39 } // namespace modules
40 
41 namespace mt = modules::time;
Definition: timebase.h:13
uint16_t Millis() const
Definition: timebase.cpp:29
bool Elapsed(uint16_t start, uint16_t timeout) const
Definition: timebase.cpp:23
void Init()
Initializes the Timebase class - sets the timers and prepares the internal variables.
Definition: timebase.cpp:11
The selector namespace provides all necessary facilities related to the logical model of the selector...
Definition: selector.cpp:13
The time namespace provides all necessary facilities related to measuring real elapsed time for the w...
Definition: timebase.cpp:7
Timebase timebase
The one and only instance of Selector in the FW.
Definition: timebase.cpp:9
The modules namespace contains models of MMU's components.
Definition: command_base.h:8