aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/common
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2021-07-25 12:17:15 +1000
committerNick Brassel <nick@tzarc.org>2021-07-25 12:17:15 +1000
commit4ec8764c70da13366f8cb7f8240e3124ea509da5 (patch)
treee5482bbd1f20e76a5b6dfa03a87d577c3e8d2ed7 /tmk_core/common
parentfdf3ce3cd1bbf931660678b0b5e138ce37c84e7c (diff)
parentb69e7431aa2e22b4f4662c64e84ed242caac055e (diff)
downloadqmk_firmware-4ec8764c70da13366f8cb7f8240e3124ea509da5.tar.gz
qmk_firmware-4ec8764c70da13366f8cb7f8240e3124ea509da5.zip
Merge remote-tracking branch 'upstream/master' into develop
Diffstat (limited to 'tmk_core/common')
-rw-r--r--tmk_core/common/arm_atsam/platform.h18
-rw-r--r--tmk_core/common/avr/platform.h20
-rw-r--r--tmk_core/common/chibios/platform.h19
-rw-r--r--tmk_core/common/print.h2
-rw-r--r--tmk_core/common/timer.h1
5 files changed, 58 insertions, 2 deletions
diff --git a/tmk_core/common/arm_atsam/platform.h b/tmk_core/common/arm_atsam/platform.h
new file mode 100644
index 000000000..f296d1d53
--- /dev/null
+++ b/tmk_core/common/arm_atsam/platform.h
@@ -0,0 +1,18 @@
1/* Copyright 2021 QMK
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18// here just to please the build
diff --git a/tmk_core/common/avr/platform.h b/tmk_core/common/avr/platform.h
new file mode 100644
index 000000000..45d9dcebf
--- /dev/null
+++ b/tmk_core/common/avr/platform.h
@@ -0,0 +1,20 @@
1/* Copyright 2021 QMK
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include <avr/pgmspace.h>
19#include <avr/io.h>
20#include <avr/interrupt.h>
diff --git a/tmk_core/common/chibios/platform.h b/tmk_core/common/chibios/platform.h
new file mode 100644
index 000000000..8243dcec5
--- /dev/null
+++ b/tmk_core/common/chibios/platform.h
@@ -0,0 +1,19 @@
1/* Copyright 2021 QMK
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include <hal.h>
19#include "chibios_config.h"
diff --git a/tmk_core/common/print.h b/tmk_core/common/print.h
index 48f91e634..8c055f549 100644
--- a/tmk_core/common/print.h
+++ b/tmk_core/common/print.h
@@ -47,7 +47,7 @@ void print_set_sendchar(sendchar_func_t func);
47# define uprintln(s) printf(s "\r\n") 47# define uprintln(s) printf(s "\r\n")
48# define uprintf printf 48# define uprintf printf
49 49
50# endif /* __AVR__ / PROTOCOL_CHIBIOS / PROTOCOL_ARM_ATSAM */ 50# endif /* __has_include_next("_print.h") */
51#else /* NO_PRINT */ 51#else /* NO_PRINT */
52# undef xprintf 52# undef xprintf
53// Remove print defines 53// Remove print defines
diff --git a/tmk_core/common/timer.h b/tmk_core/common/timer.h
index 928811a2b..02e39e79e 100644
--- a/tmk_core/common/timer.h
+++ b/tmk_core/common/timer.h
@@ -23,7 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
23#endif 23#endif
24 24
25#include <stdint.h> 25#include <stdint.h>
26#include <stdbool.h>
27 26
28#define TIMER_DIFF(a, b, max) ((max == UINT8_MAX) ? ((uint8_t)((a) - (b))) : ((max == UINT16_MAX) ? ((uint16_t)((a) - (b))) : ((max == UINT32_MAX) ? ((uint32_t)((a) - (b))) : ((a) >= (b) ? (a) - (b) : (max) + 1 - (b) + (a))))) 27#define TIMER_DIFF(a, b, max) ((max == UINT8_MAX) ? ((uint8_t)((a) - (b))) : ((max == UINT16_MAX) ? ((uint16_t)((a) - (b))) : ((max == UINT32_MAX) ? ((uint32_t)((a) - (b))) : ((a) >= (b) ? (a) - (b) : (max) + 1 - (b) + (a)))))
29#define TIMER_DIFF_8(a, b) TIMER_DIFF(a, b, UINT8_MAX) 28#define TIMER_DIFF_8(a, b) TIMER_DIFF(a, b, UINT8_MAX)