summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platforms/arm_atsam/eeprom_samd.c5
-rw-r--r--platforms/avr/drivers/i2c_master.c3
-rw-r--r--quantum/audio/audio.c1
-rw-r--r--quantum/audio/audio.h5
-rw-r--r--quantum/color.c4
-rw-r--r--quantum/midi/midi.c5
-rw-r--r--quantum/rgblight/rgblight.c8
-rw-r--r--quantum/velocikey.c8
8 files changed, 7 insertions, 32 deletions
diff --git a/platforms/arm_atsam/eeprom_samd.c b/platforms/arm_atsam/eeprom_samd.c
index 1c1e031e5d..9c42041f2d 100644
--- a/platforms/arm_atsam/eeprom_samd.c
+++ b/platforms/arm_atsam/eeprom_samd.c
@@ -15,15 +15,12 @@
15 */ 15 */
16#include "eeprom.h" 16#include "eeprom.h"
17#include "debug.h" 17#include "debug.h"
18#include "util.h"
18#include "samd51j18a.h" 19#include "samd51j18a.h"
19#include "core_cm4.h" 20#include "core_cm4.h"
20#include "component/nvmctrl.h" 21#include "component/nvmctrl.h"
21#include "eeprom_samd.h" 22#include "eeprom_samd.h"
22 23
23#ifndef MAX
24# define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
25#endif
26
27#ifndef BUSY_RETRIES 24#ifndef BUSY_RETRIES
28# define BUSY_RETRIES 10000 25# define BUSY_RETRIES 10000
29#endif 26#endif
diff --git a/platforms/avr/drivers/i2c_master.c b/platforms/avr/drivers/i2c_master.c
index 524494c99d..58939f3e00 100644
--- a/platforms/avr/drivers/i2c_master.c
+++ b/platforms/avr/drivers/i2c_master.c
@@ -23,6 +23,7 @@
23#include "i2c_master.h" 23#include "i2c_master.h"
24#include "timer.h" 24#include "timer.h"
25#include "wait.h" 25#include "wait.h"
26#include "util.h"
26 27
27#ifndef F_SCL 28#ifndef F_SCL
28# define F_SCL 400000UL // SCL frequency 29# define F_SCL 400000UL // SCL frequency
@@ -37,8 +38,6 @@
37 38
38#define TWBR_val (((F_CPU / F_SCL) - 16) / 2) 39#define TWBR_val (((F_CPU / F_SCL) - 16) / 2)
39 40
40#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
41
42void i2c_init(void) { 41void i2c_init(void) {
43 TWSR = 0; /* no prescaler */ 42 TWSR = 0; /* no prescaler */
44 TWBR = (uint8_t)TWBR_val; 43 TWBR = (uint8_t)TWBR_val;
diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c
index 3f6dc20232..2570ad9cd1 100644
--- a/quantum/audio/audio.c
+++ b/quantum/audio/audio.c
@@ -18,6 +18,7 @@
18#include "eeconfig.h" 18#include "eeconfig.h"
19#include "timer.h" 19#include "timer.h"
20#include "wait.h" 20#include "wait.h"
21#include "util.h"
21 22
22/* audio system: 23/* audio system:
23 * 24 *
diff --git a/quantum/audio/audio.h b/quantum/audio/audio.h
index 6feecb5e65..497f3dafd0 100644
--- a/quantum/audio/audio.h
+++ b/quantum/audio/audio.h
@@ -43,11 +43,6 @@ typedef union {
43 }; 43 };
44} audio_config_t; 44} audio_config_t;
45 45
46// AVR/LUFA has a MIN, arm/chibios does not
47#ifndef MIN
48# define MIN(a, b) (((a) < (b)) ? (a) : (b))
49#endif
50
51/* 46/*
52 * a 'musical note' is represented by pitch and duration; a 'musical tone' adds intensity and timbre 47 * a 'musical note' is represented by pitch and duration; a 'musical tone' adds intensity and timbre
53 * https://en.wikipedia.org/wiki/Musical_tone 48 * https://en.wikipedia.org/wiki/Musical_tone
diff --git a/quantum/color.c b/quantum/color.c
index c80078dbf2..767155c9db 100644
--- a/quantum/color.c
+++ b/quantum/color.c
@@ -17,6 +17,7 @@
17#include "color.h" 17#include "color.h"
18#include "led_tables.h" 18#include "led_tables.h"
19#include "progmem.h" 19#include "progmem.h"
20#include "util.h"
20 21
21RGB hsv_to_rgb_impl(HSV hsv, bool use_cie) { 22RGB hsv_to_rgb_impl(HSV hsv, bool use_cie) {
22 RGB rgb; 23 RGB rgb;
@@ -109,9 +110,6 @@ RGB hsv_to_rgb_nocie(HSV hsv) {
109} 110}
110 111
111#ifdef RGBW 112#ifdef RGBW
112# ifndef MIN
113# define MIN(a, b) ((a) < (b) ? (a) : (b))
114# endif
115void convert_rgb_to_rgbw(LED_TYPE *led) { 113void convert_rgb_to_rgbw(LED_TYPE *led) {
116 // Determine lowest value in all three colors, put that into 114 // Determine lowest value in all three colors, put that into
117 // the white channel and then shift all colors by that amount 115 // the white channel and then shift all colors by that amount
diff --git a/quantum/midi/midi.c b/quantum/midi/midi.c
index 1ba3e73a40..1c481f2f0b 100644
--- a/quantum/midi/midi.c
+++ b/quantum/midi/midi.c
@@ -18,10 +18,7 @@
18 18
19#include "midi.h" 19#include "midi.h"
20#include <string.h> //for memcpy 20#include <string.h> //for memcpy
21 21#include "util.h"
22#ifndef MIN
23# define MIN(x, y) (((x) < (y)) ? (x) : (y))
24#endif
25 22
26#ifndef NULL 23#ifndef NULL
27# define NULL 0 24# define NULL 0
diff --git a/quantum/rgblight/rgblight.c b/quantum/rgblight/rgblight.c
index 4c476f924f..02188df95b 100644
--- a/quantum/rgblight/rgblight.c
+++ b/quantum/rgblight/rgblight.c
@@ -21,6 +21,7 @@
21#include "rgblight.h" 21#include "rgblight.h"
22#include "color.h" 22#include "color.h"
23#include "debug.h" 23#include "debug.h"
24#include "util.h"
24#include "led_tables.h" 25#include "led_tables.h"
25#include <lib/lib8tion/lib8tion.h> 26#include <lib/lib8tion/lib8tion.h>
26#ifdef EEPROM_ENABLE 27#ifdef EEPROM_ENABLE
@@ -30,13 +31,6 @@
30# include "velocikey.h" 31# include "velocikey.h"
31#endif 32#endif
32 33
33#ifndef MIN
34# define MIN(a, b) (((a) < (b)) ? (a) : (b))
35#endif
36#ifndef MAX
37# define MAX(a, b) (((a) > (b)) ? (a) : (b))
38#endif
39
40#ifdef RGBLIGHT_SPLIT 34#ifdef RGBLIGHT_SPLIT
41/* for split keyboard */ 35/* for split keyboard */
42# define RGBLIGHT_SPLIT_SET_CHANGE_MODE rgblight_status.change_flags |= RGBLIGHT_STATUS_CHANGE_MODE 36# define RGBLIGHT_SPLIT_SET_CHANGE_MODE rgblight_status.change_flags |= RGBLIGHT_STATUS_CHANGE_MODE
diff --git a/quantum/velocikey.c b/quantum/velocikey.c
index 58e14215bb..03e91911f6 100644
--- a/quantum/velocikey.c
+++ b/quantum/velocikey.c
@@ -2,13 +2,7 @@
2#include "timer.h" 2#include "timer.h"
3#include "eeconfig.h" 3#include "eeconfig.h"
4#include "eeprom.h" 4#include "eeprom.h"
5 5#include "util.h"
6#ifndef MIN
7# define MIN(a, b) (((a) < (b)) ? (a) : (b))
8#endif
9#ifndef MAX
10# define MAX(a, b) (((a) > (b)) ? (a) : (b))
11#endif
12 6
13#define TYPING_SPEED_MAX_VALUE 200 7#define TYPING_SPEED_MAX_VALUE 200
14uint8_t typing_speed = 0; 8uint8_t typing_speed = 0;