aboutsummaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2021-07-24 19:56:45 +0100
committerGitHub <noreply@github.com>2021-07-24 19:56:45 +0100
commitb5bcd5b0a18079df1252a718588255c62d24a054 (patch)
tree886b84473e94718fed4de18a6d6c5b5b9e46eb89 /quantum
parent145d89ab9192d08b7e22a14105d27988944b7b0c (diff)
downloadqmk_firmware-b5bcd5b0a18079df1252a718588255c62d24a054.tar.gz
qmk_firmware-b5bcd5b0a18079df1252a718588255c62d24a054.zip
Refactor some platform dependent logic (#13675)
Diffstat (limited to 'quantum')
-rw-r--r--quantum/audio/luts.h10
-rw-r--r--quantum/audio/voices.h3
-rw-r--r--quantum/keymap_common.c4
-rw-r--r--quantum/quantum.h11
-rw-r--r--quantum/rgblight.c14
-rw-r--r--quantum/rgblight.h5
6 files changed, 7 insertions, 40 deletions
diff --git a/quantum/audio/luts.h b/quantum/audio/luts.h
index 74980b292..8bb045449 100644
--- a/quantum/audio/luts.h
+++ b/quantum/audio/luts.h
@@ -16,14 +16,8 @@
16 16
17#pragma once 17#pragma once
18 18
19#if defined(__AVR__) 19#include <float.h>
20# include <avr/io.h> 20#include <stdint.h>
21# include <avr/interrupt.h>
22# include <avr/pgmspace.h>
23#else
24# include <ch.h>
25# include <hal.h>
26#endif
27 21
28#define VIBRATO_LUT_LENGTH 20 22#define VIBRATO_LUT_LENGTH 20
29 23
diff --git a/quantum/audio/voices.h b/quantum/audio/voices.h
index 578350d33..1f402e7e1 100644
--- a/quantum/audio/voices.h
+++ b/quantum/audio/voices.h
@@ -18,9 +18,6 @@
18 18
19#include <stdint.h> 19#include <stdint.h>
20#include <stdbool.h> 20#include <stdbool.h>
21#if defined(__AVR__)
22# include <avr/io.h>
23#endif
24#include "wait.h" 21#include "wait.h"
25#include "luts.h" 22#include "luts.h"
26 23
diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c
index 570d4798d..e0fd6d479 100644
--- a/quantum/keymap_common.c
+++ b/quantum/keymap_common.c
@@ -19,10 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
19#include "report.h" 19#include "report.h"
20#include "keycode.h" 20#include "keycode.h"
21#include "action_layer.h" 21#include "action_layer.h"
22#if defined(__AVR__)
23# include <util/delay.h>
24# include <stdio.h>
25#endif
26#include "action.h" 22#include "action.h"
27#include "action_macro.h" 23#include "action_macro.h"
28#include "debug.h" 24#include "debug.h"
diff --git a/quantum/quantum.h b/quantum/quantum.h
index 46fc0eb1e..55f6dbb7d 100644
--- a/quantum/quantum.h
+++ b/quantum/quantum.h
@@ -15,16 +15,7 @@
15 */ 15 */
16#pragma once 16#pragma once
17 17
18#if defined(__AVR__) 18#include "platform.h"
19# include <avr/pgmspace.h>
20# include <avr/io.h>
21# include <avr/interrupt.h>
22#endif
23#if defined(PROTOCOL_CHIBIOS)
24# include <hal.h>
25# include "chibios_config.h"
26#endif
27
28#include "wait.h" 19#include "wait.h"
29#include "matrix.h" 20#include "matrix.h"
30#include "keymap.h" 21#include "keymap.h"
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index baa10ec41..04bbb1283 100644
--- a/quantum/rgblight.c
+++ b/quantum/rgblight.c
@@ -16,17 +16,6 @@
16#include <math.h> 16#include <math.h>
17#include <string.h> 17#include <string.h>
18#include <stdlib.h> 18#include <stdlib.h>
19#ifdef __AVR__
20# include <avr/eeprom.h>
21# include <avr/interrupt.h>
22#endif
23#ifdef EEPROM_ENABLE
24# include "eeprom.h"
25#endif
26#ifdef STM32_EEPROM_ENABLE
27# include <hal.h>
28# include "eeprom_stm32.h"
29#endif
30#include "wait.h" 19#include "wait.h"
31#include "progmem.h" 20#include "progmem.h"
32#include "sync_timer.h" 21#include "sync_timer.h"
@@ -35,6 +24,9 @@
35#include "debug.h" 24#include "debug.h"
36#include "led_tables.h" 25#include "led_tables.h"
37#include <lib/lib8tion/lib8tion.h> 26#include <lib/lib8tion/lib8tion.h>
27#ifdef EEPROM_ENABLE
28# include "eeprom.h"
29#endif
38#ifdef VELOCIKEY_ENABLE 30#ifdef VELOCIKEY_ENABLE
39# include "velocikey.h" 31# include "velocikey.h"
40#endif 32#endif
diff --git a/quantum/rgblight.h b/quantum/rgblight.h
index 58250a088..c05870f49 100644
--- a/quantum/rgblight.h
+++ b/quantum/rgblight.h
@@ -170,15 +170,12 @@ enum RGBLIGHT_EFFECT_MODE {
170 170
171#include <stdint.h> 171#include <stdint.h>
172#include <stdbool.h> 172#include <stdbool.h>
173#include "progmem.h"
173#include "eeconfig.h" 174#include "eeconfig.h"
174#include "ws2812.h" 175#include "ws2812.h"
175#include "color.h" 176#include "color.h"
176#include "rgblight_list.h" 177#include "rgblight_list.h"
177 178
178#if defined(__AVR__)
179# include <avr/pgmspace.h>
180#endif
181
182#ifdef RGBLIGHT_LAYERS 179#ifdef RGBLIGHT_LAYERS
183typedef struct { 180typedef struct {
184 uint8_t index; // The first LED to light 181 uint8_t index; // The first LED to light