Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
time.h
Go to the documentation of this file.
1
5// do not use pragma once here, has this can be mocked
6#ifndef PLATFORM_TIME
7#define PLATFORM_TIME
8
9#include <stdint.h>
10
11#ifdef __cplusplus
12namespace lampda {
13namespace platform {
14
15extern "C" {
16#endif
17
24 extern uint32_t time_ms(void);
25
36 extern uint64_t time_us(void);
37
44 extern void delay_ms(uint32_t dwMs);
45
51 extern void delay_us(uint64_t dwUs);
52
54 inline uint32_t time_s() { return time_ms() / 1000; }
56 inline uint32_t time_min() { return time_s() / 60; }
58 inline void delay_s(uint32_t s) { delay_ms(s * 1000); }
59
60#ifdef __cplusplus
61}
62} // namespace: platform
63} // namespace: lampda
64#endif
65
66#endif
uint32_t time_ms(void)
Returns the number of milliseconds since the Arduino board began running the current program....
Definition: time.cpp:16
void delay_us(uint64_t dwUs)
Pauses the program for the amount of time (in microseconds) specified as parameter.
Definition: time.cpp:22
void delay_ms(uint32_t dwMs)
Pauses the program for the amount of time (in miliseconds) specified as parameter....
Definition: time.cpp:20
void delay_s(uint32_t s)
pause the current task for the given number of seconds
Definition: time.h:58
uint64_t time_us(void)
Returns the number of microseconds since the Arduino board began running the current program.
Definition: time.cpp:18
uint32_t time_min()
Get the current time, in minutes.
Definition: time.h:56
uint32_t time_s()
Get the current time, in seconds.
Definition: time.h:54
Program scope.
Definition: control_fixed_modes.hpp:12