Tidy up duplication of MIN/MAX fallback implementations (#20236)
8 files changed, 7 insertions(+), 32 deletions(-) M platforms/arm_atsam/eeprom_samd.c M platforms/avr/drivers/i2c_master.c M quantum/audio/audio.c M quantum/audio/audio.h M quantum/color.c M quantum/midi/midi.c M quantum/rgblight/rgblight.c M quantum/velocikey.c
M platforms/arm_atsam/eeprom_samd.c => platforms/arm_atsam/eeprom_samd.c +1 -4
@@ 15,15 15,12 @@ */ #include "eeprom.h" #include "debug.h" #include "util.h" #include "samd51j18a.h" #include "core_cm4.h" #include "component/nvmctrl.h" #include "eeprom_samd.h" #ifndef MAX # define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) #endif #ifndef BUSY_RETRIES # define BUSY_RETRIES 10000 #endif
M platforms/avr/drivers/i2c_master.c => platforms/avr/drivers/i2c_master.c +1 -2
@@ 23,6 23,7 @@ #include "i2c_master.h" #include "timer.h" #include "wait.h" #include "util.h" #ifndef F_SCL @@ # define F_SCL 400000UL // SCL frequency 37,8 38,6 @@ #define TWBR_val (((F_CPU / F_SCL) - 16) / 2) #define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) void i2c_init(void) { TWSR = 0; /* no prescaler */ TWBR = (uint8_t)TWBR_val;
M quantum/audio/audio.c => quantum/audio/audio.c +1 -0
@@ 18,6 18,7 @@ #include "eeconfig.h" #include "timer.h" #include "wait.h" #include "util.h" /* audio system: *
M quantum/audio/audio.h => quantum/audio/audio.h +0 -5
@@ 43,11 43,6 @@ typedef union { }; } audio_config_t; // AVR/LUFA has a MIN, arm/chibios does not #ifndef MIN # define MIN(a, b) (((a) < (b)) ? (a) : (b)) #endif /* * a 'musical note' is represented by pitch and duration; a 'musical tone' adds intensity and timbre * https://en.wikipedia.org/wiki/Musical_tone
M quantum/color.c => quantum/color.c +1 -3
@@ 17,6 17,7 @@ #include "color.h" #include "led_tables.h" #include "progmem.h" #include "util.h" RGB hsv_to_rgb_impl(HSV hsv, bool use_cie) { @@ RGB rgb; 109,9 110,6 @@ RGB hsv_to_rgb_nocie(HSV hsv) { } #ifdef RGBW # ifndef MIN # define MIN(a, b) ((a) < (b) ? (a) : (b)) # endif void convert_rgb_to_rgbw(LED_TYPE *led) { // Determine lowest value in all three colors, put that into // the white channel and then shift all colors by that amount
M quantum/midi/midi.c => quantum/midi/midi.c +1 -4
@@ 18,10 18,7 @@ #include "midi.h" #include <string.h> //for memcpy #ifndef MIN # define MIN(x, y) (((x) < (y)) ? (x) : (y)) #endif #include "util.h" #ifndef NULL # define NULL 0
M quantum/rgblight/rgblight.c => quantum/rgblight/rgblight.c +1 -7
@@ 21,6 21,7 @@ #include "rgblight.h" #include "color.h" #include "debug.h" #include "util.h" #include "led_tables.h" #include <lib/lib8tion/lib8tion.h> @@ #ifdef EEPROM_ENABLE 30,13 31,6 @@ # include "velocikey.h" #endif #ifndef MIN # define MIN(a, b) (((a) < (b)) ? (a) : (b)) #endif #ifndef MAX # define MAX(a, b) (((a) > (b)) ? (a) : (b)) #endif #ifdef RGBLIGHT_SPLIT /* for split keyboard */ # define RGBLIGHT_SPLIT_SET_CHANGE_MODE rgblight_status.change_flags |= RGBLIGHT_STATUS_CHANGE_MODE
M quantum/velocikey.c => quantum/velocikey.c +1 -7