aboutsummaryrefslogtreecommitdiff
path: root/quantum/sync_timer.h
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2021-10-28 22:31:59 +0100
committerGitHub <noreply@github.com>2021-10-28 22:31:59 +0100
commitdcfffa7b67a072f7d9e37bd8c0029c53b61aeb0f (patch)
tree65491c3878ee76f50c4b46a318503cc27fdb4a6b /quantum/sync_timer.h
parent0c87e2e7025140ca6105b7fec2639c78c3cd8109 (diff)
downloadqmk_firmware-dcfffa7b67a072f7d9e37bd8c0029c53b61aeb0f.tar.gz
qmk_firmware-dcfffa7b67a072f7d9e37bd8c0029c53b61aeb0f.zip
Relocate protocol files within tmk_core/common/ (#14972)
* Relocate non platform files within tmk_core/common/ * clang
Diffstat (limited to 'quantum/sync_timer.h')
-rw-r--r--quantum/sync_timer.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/quantum/sync_timer.h b/quantum/sync_timer.h
new file mode 100644
index 000000000..9ddef45bb
--- /dev/null
+++ b/quantum/sync_timer.h
@@ -0,0 +1,54 @@
1/*
2Copyright (C) 2020 Ryan Caltabiano <https://github.com/XScorpion2>
3
4Permission is hereby granted, free of charge, to any person obtaining a copy of
5this software and associated documentation files (the "Software"), to deal in
6the Software without restriction, including without limitation the rights to
7use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8of the Software, and to permit persons to whom the Software is furnished to do
9so, subject to the following conditions:
10
11The above copyright notice and this permission notice shall be included in all
12copies or substantial portions of the Software.
13
14If you happen to meet one of the copyright holders in a bar you are obligated
15to buy them one pint of beer.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23SOFTWARE.
24*/
25
26#pragma once
27
28#include <stdint.h>
29#include "timer.h"
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#if defined(SPLIT_KEYBOARD) && !defined(DISABLE_SYNC_TIMER)
36void sync_timer_init(void);
37void sync_timer_update(uint32_t time);
38uint16_t sync_timer_read(void);
39uint32_t sync_timer_read32(void);
40uint16_t sync_timer_elapsed(uint16_t last);
41uint32_t sync_timer_elapsed32(uint32_t last);
42#else
43# define sync_timer_init()
44# define sync_timer_clear()
45# define sync_timer_update(t)
46# define sync_timer_read() timer_read()
47# define sync_timer_read32() timer_read32()
48# define sync_timer_elapsed(t) timer_elapsed(t)
49# define sync_timer_elapsed32(t) timer_elapsed32(t)
50#endif
51
52#ifdef __cplusplus
53}
54#endif