Merge branch 'master' of https://github.com/qmk/qmk_firmware into dual_audio
This commit is contained in:
		
						commit
						9f5b4e1d7a
					
				
					 56 changed files with 4466 additions and 40 deletions
				
			
		| 
						 | 
				
			
			@ -88,3 +88,31 @@ uint16_t keycode_config(uint16_t keycode) {
 | 
			
		|||
            return keycode;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint8_t mod_config(uint8_t mod) {
 | 
			
		||||
    keymap_config.raw = eeconfig_read_keymap();
 | 
			
		||||
    if (keymap_config.swap_lalt_lgui) {
 | 
			
		||||
        if ((mod & MOD_RGUI) == MOD_LGUI) {
 | 
			
		||||
            mod &= ~MOD_LGUI;
 | 
			
		||||
            mod |= MOD_LALT;
 | 
			
		||||
        } else if ((mod & MOD_RALT) == MOD_LALT) {
 | 
			
		||||
            mod &= ~MOD_LALT;
 | 
			
		||||
            mod |= MOD_LGUI;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    if (keymap_config.swap_ralt_rgui) {
 | 
			
		||||
        if ((mod & MOD_RGUI) == MOD_RGUI) {
 | 
			
		||||
            mod &= ~MOD_RGUI;
 | 
			
		||||
            mod |= MOD_RALT;
 | 
			
		||||
        } else if ((mod & MOD_RALT) == MOD_RALT) {
 | 
			
		||||
            mod &= ~MOD_RALT;
 | 
			
		||||
            mod |= MOD_RGUI;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    if (keymap_config.no_gui) {
 | 
			
		||||
        mod &= ~MOD_LGUI;
 | 
			
		||||
        mod &= ~MOD_RGUI;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return mod;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -16,11 +16,13 @@
 | 
			
		|||
 | 
			
		||||
#include "eeconfig.h"
 | 
			
		||||
#include "keycode.h"
 | 
			
		||||
#include "action_code.h"
 | 
			
		||||
 | 
			
		||||
#ifndef KEYCODE_CONFIG_H
 | 
			
		||||
#define KEYCODE_CONFIG_H
 | 
			
		||||
 | 
			
		||||
uint16_t keycode_config(uint16_t keycode);
 | 
			
		||||
uint8_t mod_config(uint8_t mod);
 | 
			
		||||
 | 
			
		||||
/* NOTE: Not portable. Bit field order depends on implementation */
 | 
			
		||||
typedef union {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -123,7 +123,8 @@ action_t action_for_key(uint8_t layer, keypos_t key)
 | 
			
		|||
            action.code = ACTION_LAYER_TAP_TOGGLE(keycode & 0xFF);
 | 
			
		||||
            break;
 | 
			
		||||
        case QK_MOD_TAP ... QK_MOD_TAP_MAX:
 | 
			
		||||
            action.code = ACTION_MODS_TAP_KEY((keycode >> 0x8) & 0x1F, keycode & 0xFF);
 | 
			
		||||
            mod = mod_config((keycode >> 0x8) & 0x1F);
 | 
			
		||||
            action.code = ACTION_MODS_TAP_KEY(mod, keycode & 0xFF);
 | 
			
		||||
            break;
 | 
			
		||||
    #ifdef BACKLIGHT_ENABLE
 | 
			
		||||
        case BL_0 ... BL_15:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										52
									
								
								quantum/keymap_extras/keymap_swedish.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								quantum/keymap_extras/keymap_swedish.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,52 @@
 | 
			
		|||
/* Copyright 2017 Andreas Lindhé
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software: you can redistribute it and/or modify
 | 
			
		||||
 * it under the terms of the GNU General Public License as published by
 | 
			
		||||
 * the Free Software Foundation, either version 2 of the License, or
 | 
			
		||||
 * (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
 * GNU General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef KEYMAP_SWEDISH_H
 | 
			
		||||
#define KEYMAP_SWEDISH_H
 | 
			
		||||
 | 
			
		||||
#include "keymap_nordic.h"
 | 
			
		||||
 | 
			
		||||
// There are slight differrences in the keyboards in the nordic contries
 | 
			
		||||
 | 
			
		||||
// Swedish redifinitions from the nordic keyset
 | 
			
		||||
#undef  NO_AE
 | 
			
		||||
#define NO_AE   KC_QUOT  // ä
 | 
			
		||||
#undef  NO_CIRC
 | 
			
		||||
#define NO_CIRC LSFT(KC_RBRC)  // ^
 | 
			
		||||
#undef  NO_GRV
 | 
			
		||||
#define NO_GRV  LSFT(NO_BSLS)  //
 | 
			
		||||
#undef  NO_OSLH
 | 
			
		||||
#define NO_OSLH KC_SCLN  // ö
 | 
			
		||||
 | 
			
		||||
// Additional Swedish keys not defined in the nordic keyset
 | 
			
		||||
#define NO_AA   KC_LBRC  // å
 | 
			
		||||
#define NO_ASTR LSFT(KC_BSLS)  // *
 | 
			
		||||
 | 
			
		||||
// Norwegian unique MAC characters (not vetted for Swedish)
 | 
			
		||||
#define NO_ACUT_MAC KC_EQL  // =
 | 
			
		||||
#define NO_APOS_MAC KC_NUBS  // '
 | 
			
		||||
#define NO_AT_MAC   KC_BSLS  // @
 | 
			
		||||
#define NO_BSLS_MAC ALGR(LSFT(KC_7)) // '\'
 | 
			
		||||
#define NO_DLR_MAC  LSFT(KC_4) // $
 | 
			
		||||
#define NO_GRV_MAC ALGR(NO_BSLS) // `
 | 
			
		||||
#define NO_GRTR_MAC LSFT(KC_GRV)  // >
 | 
			
		||||
#define NO_LCBR_MAC ALGR(LSFT(KC_8))  // }
 | 
			
		||||
#define NO_LESS_MAC KC_GRV  // >
 | 
			
		||||
#define NO_PIPE_MAC ALGR(KC_7)  // |
 | 
			
		||||
#define NO_RCBR_MAC ALGR(LSFT(KC_9))  // }
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -530,7 +530,7 @@ void send_string(const char *str) {
 | 
			
		|||
          shift = false;
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
          int hi = ascii_code>>4 & 0x0f;
 | 
			
		||||
          int hi = ascii_code>>4 & 0x0f,
 | 
			
		||||
              lo = ascii_code & 0x0f;
 | 
			
		||||
          keycode = pgm_read_byte(&ascii_to_keycode_lut[hi][lo]);
 | 
			
		||||
          shift = !!( pgm_read_word(&ascii_to_shift_lut[hi]) & (0x8000u>>lo) );
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -550,13 +550,13 @@ enum quantum_keycodes {
 | 
			
		|||
#define OSL(layer) (layer | QK_ONE_SHOT_LAYER)
 | 
			
		||||
 | 
			
		||||
// One-shot mod
 | 
			
		||||
#define OSM(mod) (mod | QK_ONE_SHOT_MOD)
 | 
			
		||||
#define OSM(mod) ((mod) | QK_ONE_SHOT_MOD)
 | 
			
		||||
 | 
			
		||||
// Layer tap-toggle
 | 
			
		||||
#define TT(layer) (layer | QK_LAYER_TAP_TOGGLE)
 | 
			
		||||
 | 
			
		||||
// M-od, T-ap - 256 keycode max
 | 
			
		||||
#define MT(mod, kc) (kc | QK_MOD_TAP | ((mod & 0x1F) << 8))
 | 
			
		||||
#define MT(mod, kc) (kc | QK_MOD_TAP | (((mod) & 0x1F) << 8))
 | 
			
		||||
 | 
			
		||||
#define CTL_T(kc) MT(MOD_LCTL, kc)
 | 
			
		||||
#define LCTL_T(kc) MT(MOD_LCTL, kc)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -41,8 +41,8 @@ static void keyframe_fade_all_leds_from_to(keyframe_animation_t* animation, uint
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
// TODO: Should be customizable per keyboard
 | 
			
		||||
#define NUM_ROWS 7
 | 
			
		||||
#define NUM_COLS 7
 | 
			
		||||
#define NUM_ROWS LED_NUM_ROWS
 | 
			
		||||
#define NUM_COLS LED_NUM_COLS
 | 
			
		||||
 | 
			
		||||
static uint8_t crossfade_start_frame[NUM_ROWS][NUM_COLS];
 | 
			
		||||
static uint8_t crossfade_end_frame[NUM_ROWS][NUM_COLS];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -105,15 +105,19 @@ static remote_object_t* remote_objects[] = {
 | 
			
		|||
GDisplay* LCD_DISPLAY = 0;
 | 
			
		||||
GDisplay* LED_DISPLAY = 0;
 | 
			
		||||
 | 
			
		||||
#ifdef LCD_DISPLAY_NUMBER
 | 
			
		||||
__attribute__((weak))
 | 
			
		||||
GDisplay* get_lcd_display(void) {
 | 
			
		||||
    return gdispGetDisplay(0);
 | 
			
		||||
    return gdispGetDisplay(LCD_DISPLAY_NUMBER);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef LED_DISPLAY_NUMBER
 | 
			
		||||
__attribute__((weak))
 | 
			
		||||
GDisplay* get_led_display(void) {
 | 
			
		||||
    return gdispGetDisplay(1);
 | 
			
		||||
    return gdispGetDisplay(LED_DISPLAY_NUMBER);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
void start_keyframe_animation(keyframe_animation_t* animation) {
 | 
			
		||||
    animation->current_frame = -1;
 | 
			
		||||
| 
						 | 
				
			
			@ -251,9 +255,9 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
 | 
			
		|||
        .mods = 0xFF,
 | 
			
		||||
        .leds = 0xFFFFFFFF,
 | 
			
		||||
        .suspended = false,
 | 
			
		||||
#ifdef VISUALIZER_USER_DATA_SIZE
 | 
			
		||||
    #ifdef VISUALIZER_USER_DATA_SIZE
 | 
			
		||||
        .user_data = {0},
 | 
			
		||||
#endif
 | 
			
		||||
    #endif
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    visualizer_state_t state = {
 | 
			
		||||
| 
						 | 
				
			
			@ -379,25 +383,26 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
 | 
			
		|||
void visualizer_init(void) {
 | 
			
		||||
    gfxInit();
 | 
			
		||||
 | 
			
		||||
#ifdef LCD_BACKLIGHT_ENABLE
 | 
			
		||||
  #ifdef LCD_BACKLIGHT_ENABLE
 | 
			
		||||
    lcd_backlight_init();
 | 
			
		||||
#endif
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
#ifdef SERIAL_LINK_ENABLE
 | 
			
		||||
  #ifdef SERIAL_LINK_ENABLE
 | 
			
		||||
    add_remote_objects(remote_objects, sizeof(remote_objects) / sizeof(remote_object_t*) );
 | 
			
		||||
#endif
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
#ifdef LCD_ENABLE
 | 
			
		||||
  #ifdef LCD_ENABLE
 | 
			
		||||
    LCD_DISPLAY = get_lcd_display();
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef BACKLIGHT_ENABLE
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
  #ifdef BACKLIGHT_ENABLE
 | 
			
		||||
    LED_DISPLAY = get_led_display();
 | 
			
		||||
#endif
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
    // We are using a low priority thread, the idea is to have it run only
 | 
			
		||||
    // when the main thread is sleeping during the matrix scanning
 | 
			
		||||
    gfxThreadCreate(visualizerThreadStack, sizeof(visualizerThreadStack),
 | 
			
		||||
                              VISUALIZER_THREAD_PRIORITY, visualizerThread, NULL);
 | 
			
		||||
  gfxThreadCreate(visualizerThreadStack, sizeof(visualizerThreadStack),
 | 
			
		||||
                  VISUALIZER_THREAD_PRIORITY, visualizerThread, NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void update_status(bool changed) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -51,19 +51,23 @@ GFXSRC := $(patsubst $(TOP_DIR)/%,%,$(GFXSRC))
 | 
			
		|||
GFXDEFS := $(patsubst %,-D%,$(patsubst -D%,%,$(GFXDEFS)))
 | 
			
		||||
 | 
			
		||||
ifneq ("$(wildcard $(KEYMAP_PATH)/visualizer.c)","")
 | 
			
		||||
	SRC += keyboards/$(KEYBOARD)/keymaps/$(KEYMAP)/visualizer.c
 | 
			
		||||
    SRC += keyboards/$(KEYBOARD)/keymaps/$(KEYMAP)/visualizer.c
 | 
			
		||||
else 
 | 
			
		||||
	ifeq ("$(wildcard $(SUBPROJECT_PATH)/keymaps/$(KEYMAP)/visualizer.c)","")
 | 
			
		||||
		ifeq ("$(wildcard $(SUBPROJECT_PATH)/visualizer.c)","")
 | 
			
		||||
$(error "$(KEYMAP_PATH)/visualizer.c" does not exist)
 | 
			
		||||
		else
 | 
			
		||||
			SRC += keyboards/$(KEYBOARD)/$(SUBPROJECT)/visualizer.c
 | 
			
		||||
		endif
 | 
			
		||||
	else
 | 
			
		||||
		SRC += keyboards/$(KEYBOARD)/$(SUBPROJECT)/keymaps/$(KEYMAP)/visualizer.c
 | 
			
		||||
	endif
 | 
			
		||||
    ifeq ("$(wildcard $(SUBPROJECT_PATH)/keymaps/$(KEYMAP)/visualizer.c)","")
 | 
			
		||||
        ifeq ("$(wildcard $(SUBPROJECT_PATH)/visualizer.c)","")
 | 
			
		||||
            ifeq ("$(wildcard $(KEYBOARD_PATH)/visualizer.c)","")
 | 
			
		||||
$(error "visualizer.c" not found")
 | 
			
		||||
            else
 | 
			
		||||
               SRC += keyboards/$(KEYBOARD)/visualizer.c
 | 
			
		||||
            endif
 | 
			
		||||
        else
 | 
			
		||||
            SRC += keyboards/$(KEYBOARD)/$(SUBPROJECT)/visualizer.c
 | 
			
		||||
        endif
 | 
			
		||||
    else
 | 
			
		||||
        SRC += keyboards/$(KEYBOARD)/$(SUBPROJECT)/keymaps/$(KEYMAP)/visualizer.c
 | 
			
		||||
    endif
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
ifdef EMULATOR
 | 
			
		||||
UINCDIR += $(TMK_DIR)/common
 | 
			
		||||
endif
 | 
			
		||||
endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue