diff options
Diffstat (limited to 'quantum')
110 files changed, 484 insertions, 276 deletions
diff --git a/quantum/action_code.h b/quantum/action_code.h index 58d929016d..d9a575b518 100644 --- a/quantum/action_code.h +++ b/quantum/action_code.h @@ -17,6 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #pragma once +#include "modifiers.h" + /** \brief Action codes * * 16bit code: action_kind(4bit) + action_parameter(12bit) @@ -160,28 +162,6 @@ typedef union { #define ACTION_TRANSPARENT 1 #define ACTION(kind, param) ((kind) << 12 | (param)) -/** \brief Key Actions - * - * Mod bits: 43210 - * bit 0 ||||+- Control - * bit 1 |||+-- Shift - * bit 2 ||+--- Alt - * bit 3 |+---- Gui - * bit 4 +----- LR flag(Left:0, Right:1) - */ -enum mods_bit { - MOD_LCTL = 0x01, - MOD_LSFT = 0x02, - MOD_LALT = 0x04, - MOD_LGUI = 0x08, - MOD_RCTL = 0x11, - MOD_RSFT = 0x12, - MOD_RALT = 0x14, - MOD_RGUI = 0x18, -}; -#define MOD_HYPR (MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI) -#define MOD_MEH (MOD_LCTL | MOD_LSFT | MOD_LALT) - enum mods_codes { MODS_ONESHOT = 0x00, MODS_TAP_TOGGLE = 0x01, diff --git a/quantum/action_util.h b/quantum/action_util.h index 6f1f09c4bd..0ecf15ae4b 100644 --- a/quantum/action_util.h +++ b/quantum/action_util.h @@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <stdint.h> #include "report.h" +#include "modifiers.h" #ifdef __cplusplus extern "C" { diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c index ca78a483ad..2570ad9cd1 100644 --- a/quantum/audio/audio.c +++ b/quantum/audio/audio.c @@ -18,6 +18,7 @@ #include "eeconfig.h" #include "timer.h" #include "wait.h" +#include "util.h" /* audio system: * @@ -112,6 +113,10 @@ static bool audio_initialized = false; static bool audio_driver_stopped = true; audio_config_t audio_config; +void eeconfig_update_audio_current(void) { + eeconfig_update_audio(audio_config.raw); +} + void audio_init(void) { if (audio_initialized) { return; diff --git a/quantum/audio/audio.h b/quantum/audio/audio.h index fe23cf3ed1..497f3dafd0 100644 --- a/quantum/audio/audio.h +++ b/quantum/audio/audio.h @@ -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 @@ -64,6 +59,11 @@ typedef struct { // public interface /** + * @brief Save the current choices to the eeprom + */ +void eeconfig_update_audio_current(void); + +/** * @brief one-time initialization called by quantum/quantum.c * @details usually done lazy, when some tones are to be played * diff --git a/quantum/bootmagic/magic.c b/quantum/bootmagic/magic.c index f1cb11c395..d68df3fa58 100644 --- a/quantum/bootmagic/magic.c +++ b/quantum/bootmagic/magic.c @@ -19,7 +19,7 @@ #include "matrix.h" #include "bootloader.h" #include "debug.h" -#include "keymap.h" +#include "keycode_config.h" #include "host.h" #include "action_layer.h" #include "eeconfig.h" 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 @@ #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 diff --git a/quant |