From c204c735af9fc5bf2438ca4fedfc8914529d660e Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Tue, 22 Feb 2022 01:30:49 +0900 Subject: [PATCH 01/14] Helix/pico move to split_common (#16418) --- keyboards/helix/pico/config.h | 10 +- keyboards/helix/pico/keymaps/biacco/keymap.c | 35 +- keyboards/helix/pico/keymaps/biacco/rules.mk | 6 +- keyboards/helix/pico/keymaps/default/keymap.c | 135 +------ .../helix/pico/keymaps/default/readme.md | 6 +- .../helix/pico/keymaps/default/readme_jp.md | 14 +- keyboards/helix/pico/keymaps/default/rules.mk | 6 +- keyboards/helix/pico/keymaps/mtei/keymap.c | 163 +-------- keyboards/helix/pico/keymaps/mtei/rules.mk | 6 +- keyboards/helix/pico/matrix.c | 342 ------------------ .../override_helix_options.mk-maintenance | 42 +++ keyboards/helix/pico/pico.c | 29 +- keyboards/helix/pico/pico.h | 20 +- keyboards/helix/pico/post_rules.mk | 138 ++----- keyboards/helix/pico/qmk_conf/rules.mk | 2 - keyboards/helix/pico/rules.mk | 4 +- keyboards/helix/pico/split_util.c | 104 ------ keyboards/helix/pico/split_util.h | 16 - 18 files changed, 165 insertions(+), 913 deletions(-) delete mode 100644 keyboards/helix/pico/matrix.c create mode 100644 keyboards/helix/pico/override_helix_options.mk-maintenance delete mode 100644 keyboards/helix/pico/split_util.c delete mode 100644 keyboards/helix/pico/split_util.h diff --git a/keyboards/helix/pico/config.h b/keyboards/helix/pico/config.h index b01fd3a001..ea2ce8c941 100644 --- a/keyboards/helix/pico/config.h +++ b/keyboards/helix/pico/config.h @@ -1,6 +1,7 @@ /* Copyright 2012 Jun Wako Copyright 2015 Jack Humbert +Copyright 2018 MakotoKurauchi 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 @@ -42,12 +43,6 @@ along with this program. If not, see . // #define MASTER_RIGHT // #define EE_HANDS -// Helix keyboard OLED support -// see ./rules.mk: OLED_ENABLE=yes or no -#ifdef OLED_ENABLE - #define SSD1306OLED -#endif - /* key matrix size */ // Rows are doubled-up #define MATRIX_ROWS 8 @@ -114,8 +109,7 @@ along with this program. If not, see . #if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) // USB_MAX_POWER_CONSUMPTION value for Helix keyboard -// 120 RGBoff, OLEDoff -// 120 OLED +// 120 RGBoff // 330 RGB 6 // 300 RGB 32 // 310 OLED & RGB 32 diff --git a/keyboards/helix/pico/keymaps/biacco/keymap.c b/keyboards/helix/pico/keymaps/biacco/keymap.c index a1d041c022..aa196c7e6a 100644 --- a/keyboards/helix/pico/keymaps/biacco/keymap.c +++ b/keyboards/helix/pico/keymaps/biacco/keymap.c @@ -1,24 +1,19 @@ +/* Copyright 2018 Biacco42 + * + * 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 . + */ #include QMK_KEYBOARD_H -#include "bootloader.h" -#ifdef PROTOCOL_LUFA -#include "lufa.h" -#include "split_util.h" -#endif -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif -#ifdef SSD1306OLED - #include "ssd1306.h" -#endif - -extern keymap_config_t keymap_config; - -#ifdef RGBLIGHT_ENABLE -//Following line allows macro to read current RGB settings -extern rgblight_config_t rgblight_config; -#endif - -extern uint8_t is_master; // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/helix/pico/keymaps/biacco/rules.mk b/keyboards/helix/pico/keymaps/biacco/rules.mk index 993ade2673..d971359461 100644 --- a/keyboards/helix/pico/keymaps/biacco/rules.mk +++ b/keyboards/helix/pico/keymaps/biacco/rules.mk @@ -10,10 +10,8 @@ AUDIO_ENABLE = yes # Audio output on port B5 LTO_ENABLE = no # if firmware size over limit, try this option # Helix Spacific Build Options -# you can uncomment and edit follows 6 Variables -# jp: 以下の6つの変数を必要に応じて編集し、コメントアウトをはずします。 -# OLED_ENABLE = no # OLED_ENABLE -# LOCAL_GLCDFONT = no # use each keymaps "helixfont.h" insted of "common/glcdfont.c" +# you can uncomment and edit follows 4 Variables +# jp: 以下の4つの変数を必要に応じて編集し、コメントアウトをはずします。 # LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) # LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) LED_ANIMATIONS = no # LED animations diff --git a/keyboards/helix/pico/keymaps/default/keymap.c b/keyboards/helix/pico/keymaps/default/keymap.c index f23ab85761..11ee30258c 100644 --- a/keyboards/helix/pico/keymaps/default/keymap.c +++ b/keyboards/helix/pico/keymaps/default/keymap.c @@ -1,24 +1,25 @@ +/* Copyright 2018 MakotoKurauchi + * + * 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 . + */ #include QMK_KEYBOARD_H -#include "bootloader.h" -#ifdef PROTOCOL_LUFA -#include "lufa.h" -#include "split_util.h" -#endif -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif -#ifdef SSD1306OLED - #include "ssd1306.h" -#endif - #ifdef RGBLIGHT_ENABLE //Following line allows macro to read current RGB settings extern rgblight_config_t rgblight_config; #endif -extern uint8_t is_master; - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them @@ -334,10 +335,6 @@ void matrix_init_user(void) { #ifdef RGBLIGHT_ENABLE RGB_current_mode = rgblight_config.mode; #endif - //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h - #ifdef SSD1306OLED - iota_gfx_init(!has_usb()); // turns on the display - #endif } @@ -365,105 +362,3 @@ void music_scale_user(void) } #endif - - -//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h -#ifdef SSD1306OLED - -void matrix_scan_user(void) { - iota_gfx_task(); // this is what updates the display continuously -} - -void matrix_update(struct CharacterMatrix *dest, - const struct CharacterMatrix *source) { - if (memcmp(dest->display, source->display, sizeof(dest->display))) { - memcpy(dest->display, source->display, sizeof(dest->display)); - dest->dirty = true; - } -} - -//assign the right code to your layers for OLED display -#define L_BASE 0 -#define L_LOWER (1<<_LOWER) -#define L_RAISE (1<<_RAISE) -#define L_ADJUST (1<<_ADJUST) -#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) - -static void render_logo(struct CharacterMatrix *matrix) { - - static char logo[]={ - 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, - 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, - 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, - 0}; - matrix_write(matrix, logo); - //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); -} - - - -void render_status(struct CharacterMatrix *matrix) { - - // Render to mode icon - static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; - if(keymap_config.swap_lalt_lgui==false){ - matrix_write(matrix, logo[0][0]); - matrix_write_P(matrix, PSTR("\n")); - matrix_write(matrix, logo[0][1]); - }else{ - matrix_write(matrix, logo[1][0]); - matrix_write_P(matrix, PSTR("\n")); - matrix_write(matrix, logo[1][1]); - } - - // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below - char buf[40]; - snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); - matrix_write_P(matrix, PSTR("\nLayer: ")); - switch (layer_state) { - case L_BASE: - matrix_write_P(matrix, PSTR("Default")); - break; - case L_RAISE: - matrix_write_P(matrix, PSTR("Raise")); - break; - case L_LOWER: - matrix_write_P(matrix, PSTR("Lower")); - break; - case L_ADJUST: - case L_ADJUST_TRI: - matrix_write_P(matrix, PSTR("Adjust")); - break; - default: - matrix_write(matrix, buf); - } - - // Host Keyboard LED Status - char led[40]; - snprintf(led, sizeof(led), "\n%s %s %s", - (host_keyboard_leds() & (1<. + */ #include QMK_KEYBOARD_H -#include "bootloader.h" -#ifdef PROTOCOL_LUFA -#include "lufa.h" -#include "split_util.h" -#endif -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif -#ifdef SSD1306OLED - #include "ssd1306.h" -#endif -#ifdef CONSOLE_ENABLE - #include -#endif #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) #define kc5(a,b,c,d,e) KC_##a, KC_##b, KC_##c, KC_##d, KC_##e -extern keymap_config_t keymap_config; - -#ifdef RGBLIGHT_ENABLE -//Following line allows macro to read current RGB settings -extern rgblight_config_t rgblight_config; -#endif - -extern uint8_t is_master; - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them @@ -373,10 +365,6 @@ void matrix_init_user(void) { #ifdef AUDIO_ENABLE startup_user(); #endif - //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h - #ifdef SSD1306OLED - iota_gfx_init(!has_usb()); // turns on the display - #endif } @@ -404,124 +392,3 @@ void music_scale_user(void) } #endif - - -//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h -#ifdef SSD1306OLED - -void matrix_scan_user(void) { - iota_gfx_task(); // this is what updates the display continuously -} - -void matrix_update(struct CharacterMatrix *dest, - const struct CharacterMatrix *source) { - if (memcmp(dest->display, source->display, sizeof(dest->display))) { - memcpy(dest->display, source->display, sizeof(dest->display)); - dest->dirty = true; - } -} - -static void render_logo(struct CharacterMatrix *matrix) { - - static char logo[]={ - 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, - 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, - 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, - 0}; - matrix_write(matrix, logo); -#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_ANIMATIONS) - char buf[30]; - if(rgblight_config.enable) { - snprintf(buf, sizeof(buf), " LED %2d: %d,%d,%d ", - rgblight_config.mode, - rgblight_config.hue/RGBLIGHT_HUE_STEP, - rgblight_config.sat/RGBLIGHT_SAT_STEP, - rgblight_config.val/RGBLIGHT_VAL_STEP); - matrix_write(matrix, buf); - } -#endif - //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); -} - -static const char Qwerty_name[] PROGMEM = " Qwerty"; -static const char Colemak_name[] PROGMEM = " Colemak"; -static const char Dvorak_name[] PROGMEM = " Dvorak"; -static const char Eucalyn_name[] PROGMEM = " Eucalyn"; - -static const char NumL_name[] PROGMEM = ":NumL"; -static const char NumR_name[] PROGMEM = ":NumR"; -static const char Lower_name[] PROGMEM = ":Func"; -static const char Raise_name[] PROGMEM = ":Extra"; -static const char Adjust_name[] PROGMEM = ":Adjust"; - -static const char *layer_names[] = { - [_QWERTY] = Qwerty_name, - [_COLEMAK] = Colemak_name, - [_DVORAK] = Dvorak_name, - [_EUCALYN] = Eucalyn_name, - - [_NUML] = NumL_name, - [_NUMR] = NumR_name, - [_LOWER] = Lower_name, - [_RAISE] = Raise_name, - [_ADJUST] = Adjust_name -}; - -void render_status(struct CharacterMatrix *matrix) { - - // Render to mode icon - static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; - if(keymap_config.swap_lalt_lgui==false){ - matrix_write(matrix, logo[0][0]); - matrix_write_P(matrix, PSTR("\n")); - matrix_write(matrix, logo[0][1]); - }else{ - matrix_write(matrix, logo[1][0]); - matrix_write_P(matrix, PSTR("\n")); - matrix_write(matrix, logo[1][1]); - } - - // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below - int name_num; - uint32_t lstate; - matrix_write_P(matrix, layer_names[current_default_layer]); - matrix_write_P(matrix, PSTR("\n")); - for( lstate = layer_state, name_num = 0; - lstate && name_num < sizeof(layer_names)/sizeof(char *); - lstate >>=1, name_num++ ) { - if( (lstate & 1) != 0 ) { - if( layer_names[name_num] ) { - matrix_write_P(matrix, layer_names[name_num]); - } - } - } - - // Host Keyboard LED Status - char led[40]; - snprintf(led, sizeof(led), "\n%s %s %s", - (host_keyboard_leds() & (1< - -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 . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include -#include -#include -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "quantum.h" - -#ifdef USE_MATRIX_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -#define ERROR_DISCONNECT_COUNT 5 - -static uint8_t debouncing = DEBOUNCE; -static const int ROWS_PER_HAND = MATRIX_ROWS/2; -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); -static uint8_t matrix_master_scan(void); - - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - split_keyboard_setup(); - - // initialize row and col - unselect_rows(); - init_cols(); - - setPinOutput(B0); - setPinOutput(D5); - writePinHigh(B0); - writePinHigh(D5); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - - matrix_init_quantum(); -} - -uint8_t _matrix_scan(void) -{ - // Right hand is stored after the left in the matirx so, we need to offset it - int offset = isLeftHand ? 0 : (ROWS_PER_HAND); - - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - select_row(i); - _delay_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - if (matrix_debouncing[i+offset] != cols) { - matrix_debouncing[i+offset] = cols; - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - } - } - - return 1; -} - -#ifdef USE_MATRIX_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - int ret=serial_update_buffers(); - if (ret ) { - if(ret==2) writePinLow(B0); - return 1; - } - writePinHigh(B0); - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - if (is_helix_master()) { - matrix_master_scan(); - }else{ - matrix_slave_scan(); - - int offset = (isLeftHand) ? ROWS_PER_HAND : 0; - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[offset+i] = serial_master_buffer[i]; - } - - matrix_scan_quantum(); - } - return 1; -} - - -uint8_t matrix_master_scan(void) { - - int ret = _matrix_scan(); - -#ifndef KEYBOARD_helix_rev1 - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_MATRIX_I2C -// for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ -// i2c_slave_buffer[i] = matrix[offset+i]; -// } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_master_buffer[i] = matrix[offset+i]; - } -#endif -#endif - -#ifdef USE_MATRIX_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - writePinLow(D5); - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - writePinHigh(D5); - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_MATRIX_I2C - for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ - i2c_slave_buffer[i] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } -#endif -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); - _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); - } -} - -static matrix_row_t read_cols(void) -{ - matrix_row_t result = 0; - for(int x = 0; x < MATRIX_COLS; x++) { - result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); - } - return result; -} - -static void unselect_rows(void) -{ - for(int x = 0; x < ROWS_PER_HAND; x++) { - _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); - _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); - } -} - -static void select_row(uint8_t row) -{ - _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); - _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); -} diff --git a/keyboards/helix/pico/override_helix_options.mk-maintenance b/keyboards/helix/pico/override_helix_options.mk-maintenance new file mode 100644 index 0000000000..0ff930957e --- /dev/null +++ b/keyboards/helix/pico/override_helix_options.mk-maintenance @@ -0,0 +1,42 @@ +# +# This file is not normally used. It is used for maintenance testing purposes. +# To use it, do the following: +# +# $ cp override_helix_options.mk-maintenance override_helix_options.mk +# +$(info -------------------------) +$(info override_helix_options.mk) +$(info -------------------------) + +define HELIX_OVERRIDE_PARSE + ifeq ($(strip $1),back) + LED_BACK_ENABLE = yes + LED_UNDERGLOW_ENABLE = no + endif + ifeq ($(strip $1),under) + LED_BACK_ENABLE = no + LED_UNDERGLOW_ENABLE = yes + endif + ifneq ($(filter noled led-off led_off,$(strip $1)),) + LED_BACK_ENABLE = no + LED_UNDERGLOW_ENABLE = no + endif + ifneq ($(filter noaudio audio-off audio_off,$(strip $1)),) + AUDIO_ENABLE = no + endif + ifneq ($(filter audio audio-on audio_on,$(strip $1)),) + AUDIO_ENABLE = yes + endif + ifneq ($(filter sc split-common split_common,$(strip $1)),) + SPLIT_KEYBOARD = yes + endif + ifneq ($(filter nosc no-sc no-split-common no-split_common,$(strip $1)),) + SPLIT_KEYBOARD = no + endif + ifeq ($(strip $1),scan) + DEBUG_MATRIX_SCAN_RATE_ENABLE = yes + endif + ifeq ($(strip $1),scan-api) + DEBUG_MATRIX_SCAN_RATE_ENABLE = api + endif +endef # end of HELIX_OVERRIDE_PARSE diff --git a/keyboards/helix/pico/pico.c b/keyboards/helix/pico/pico.c index 315b35a7ae..4cd1953632 100644 --- a/keyboards/helix/pico/pico.c +++ b/keyboards/helix/pico/pico.c @@ -1,3 +1,18 @@ +/* Copyright 2018 MakotoKurauchi + * + * 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 . + */ #include "helix.h" // Each keymap.c should use is_keyboard_master() instead of 'is_master'. @@ -5,14 +20,6 @@ // for the old keymap.c. uint8_t is_master = false; -#ifdef SSD1306OLED -#include "ssd1306.h" - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - return process_record_gfx(keycode,record) && process_record_user(keycode, record); -} -#endif - void matrix_init_kb(void) { // Each keymap.c should use is_keyboard_master() instead of is_master. // But keep is_master for a while for backwards compatibility @@ -28,9 +35,3 @@ void keyboard_post_init_kb(void) { #endif keyboard_post_init_user(); } - -#if defined(SPLIT_KEYBOARD) && defined(SSD1306OLED) -void matrix_slave_scan_user(void) { - matrix_scan_user(); -} -#endif diff --git a/keyboards/helix/pico/pico.h b/keyboards/helix/pico/pico.h index 5fa5f72958..3e51d54d84 100644 --- a/keyboards/helix/pico/pico.h +++ b/keyboards/helix/pico/pico.h @@ -1,12 +1,22 @@ +/* Copyright 2018 MakotoKurauchi + * + * 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 . + */ #pragma once #include "helix.h" -#ifndef SPLIT_KEYBOARD - extern bool is_helix_master(void); - #define is_keyboard_master() is_helix_master() -#endif - // Each keymap.c should use is_keyboard_master() instead of 'is_master', 'has_usb()'. // But keep 'is_master' for a while for backwards compatibility // for the old keymap.c. diff --git a/keyboards/helix/pico/post_rules.mk b/keyboards/helix/pico/post_rules.mk index 38573d75a5..88bb5482ba 100644 --- a/keyboards/helix/pico/post_rules.mk +++ b/keyboards/helix/pico/post_rules.mk @@ -4,90 +4,30 @@ # Post-processing rules convert keyboard-specific shortcuts (that represent # combinations of standard options) into QMK standard options. # +-include $(strip $(HELIX_TOP_DIR)/pico/override_helix_options.mk) ## File dedicated to maintenance -define HELIX_CUSTOMISE_MSG - $(info Helix Spacific Build Options) - $(info - OLED_ENABLE = $(OLED_ENABLE)) - $(info - LED_BACK_ENABLE = $(LED_BACK_ENABLE)) - $(info - LED_UNDERGLOW_ENABLE = $(LED_UNDERGLOW_ENABLE)) - $(info - LED_ANIMATIONS = $(LED_ANIMATIONS)) - $(info - IOS_DEVICE_ENABLE = $(IOS_DEVICE_ENABLE)) - $(info ) -endef +# Parse 'HELIX=xx,yy,zz' option +ifneq ($(strip $(HELIX)),) + # make HELIX=ios helix/pico:AKEYMAP + # make HELIX=no-ani helix/pico:AKEYMAP + # make HELIX=ios,no-ani helix/pico:AKEYMAP + define HELIX_OPTION_PARSE + # parce 'no-ani' 'ios' + $(if $(SHOW_PARCE),$(info parse .$1.)) #debug + $(if $(HELIX_OVERRIDE_PARSE),$(call HELIX_OVERRIDE_PARSE,$1)) -define HELIX_HELP_MSG - $(info Helix keyboard convenient command line option) - $(info - make HELIX= helix/pico:) - $(info - option= oled | back | under | na | no-ani) - $(info - ios | sc | split-common | scan | verbose) - $(info - ex.) - $(info - make HELIX=oled helix/pico:) - $(info - make HELIX=back helix/pico:) - $(info - make HELIX=under helix/pico:) - $(info - make HELIX=back,na helix/pico:) - $(info - make HELIX=back,ios helix/pico:) - $(info ) -endef + ifeq ($(strip $1),ios) + IOS_DEVICE_ENABLE = yes + endif + ifneq ($(filter na no_ani no-ani,$(strip $1)),) + LED_ANIMATIONS = no + endif + endef # end of HELIX_OPTION_PARSE - ifneq ($(strip $(HELIX)),) COMMA=, - helix_option := $(subst $(COMMA), , $(HELIX)) - ifneq ($(filter help,$(helix_option)),) - $(eval $(call HELIX_HELP_MSG)) - $(error ) - endif - ifneq ($(filter oled,$(helix_option)),) - OLED_ENABLE = yes - endif - ifneq ($(filter back,$(helix_option)),) - LED_BACK_ENABLE = yes - else ifneq ($(filter under,$(helix_option)),) - LED_UNDERGLOW_ENABLE = yes - endif - ifneq ($(filter na,$(helix_option)),) - LED_ANIMATIONS = no - endif - ifneq ($(filter no_ani,$(helix_option)),) - LED_ANIMATIONS = no - endif - ifneq ($(filter no-ani,$(helix_option)),) - LED_ANIMATIONS = no - endif - ifneq ($(filter ios,$(helix_option)),) - IOS_DEVICE_ENABLE = yes - endif - ifneq ($(filter sc,$(helix_option)),) - SPLIT_KEYBOARD = yes - endif - ifneq ($(filter split-common,$(helix_option)),) - SPLIT_KEYBOARD = yes - endif - ifneq ($(filter scan,$(helix_option)),) - # use DEBUG_MATRIX_SCAN_RATE - # see docs/newbs_testing_debugging.md - OPT_DEFS += -DDEBUG_MATRIX_SCAN_RATE - CONSOLE_ENABLE = yes - SHOW_VERBOSE_INFO = yes - endif - ifneq ($(filter verbose,$(helix_option)),) - SHOW_VERBOSE_INFO = yes - endif + $(eval $(foreach A_OPTION_NAME,$(subst $(COMMA), ,$(HELIX)), \ + $(call HELIX_OPTION_PARSE,$(A_OPTION_NAME)))) SHOW_HELIX_OPTIONS = yes - endif - -ifneq ($(strip $(SPLIT_KEYBOARD)), yes) - SRC += local_drivers/serial.c - KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers - - # A workaround until #7089 is merged. - # serial.c must not be compiled with the -lto option. - # The current LIB_SRC has a side effect with the -fno-lto option, so use it. - LIB_SRC += local_drivers/serial.c - - CUSTOM_MATRIX = yes - - SRC += pico/matrix.c - SRC += pico/split_util.c endif ######## @@ -98,7 +38,6 @@ ifeq ($(strip $(LED_BACK_ENABLE)), yes) RGBLIGHT_ENABLE = yes OPT_DEFS += -DRGBLED_BACK ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) - $(eval $(call HELIX_CUSTOMISE_MSG)) $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes') endif else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) @@ -113,35 +52,26 @@ ifeq ($(strip $(LED_ANIMATIONS)), yes) OPT_DEFS += -DLED_ANIMATIONS endif -ifeq ($(strip $(OLED_ENABLE)), yes) - SRC += local_drivers/i2c.c - SRC += local_drivers/ssd1306.c - KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers - OPT_DEFS += -DOLED_ENABLE - ifeq ($(strip $(LOCAL_GLCDFONT)), yes) - OPT_DEFS += -DLOCAL_GLCDFONT - endif -endif - ifeq ($(strip $(AUDIO_ENABLE)),yes) ifeq ($(strip $(RGBLIGHT_ENABLE)),yes) LTO_ENABLE = yes endif - ifeq ($(strip $(OLED_ENABLE)),yes) - LTO_ENABLE = yes - endif endif ifneq ($(strip $(SHOW_HELIX_OPTIONS)),) - $(eval $(call HELIX_CUSTOMISE_MSG)) - ifneq ($(strip $(SHOW_VERBOSE_INFO)),) - $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE)) - $(info -- CONSOLE_ENABLE = $(CONSOLE_ENABLE)) - $(info -- OPT_DEFS = $(OPT_DEFS)) - $(info -- SPLIT_KEYBOARD = $(SPLIT_KEYBOARD)) - $(info -- LTO_ENABLE = $(LTO_ENABLE)) - $(info ) - endif + $(info Helix Spacific Build Options) + $(info - LED_BACK_ENABLE = $(LED_BACK_ENABLE)) + $(info - LED_UNDERGLOW_ENABLE = $(LED_UNDERGLOW_ENABLE)) + $(info - LED_ANIMATIONS = $(LED_ANIMATIONS)) + $(info - IOS_DEVICE_ENABLE = $(IOS_DEVICE_ENABLE)) + $(info ) + $(info QMK Build Options) + $(info -- SPLIT_KEYBOARD = $(SPLIT_KEYBOARD)) + $(info -- AUDIO_ENABLE = $(AUDIO_ENABLE)) + $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE)) + $(info -- CONSOLE_ENABLE = $(CONSOLE_ENABLE)) + $(info -- OPT_DEFS = $(OPT_DEFS)) + $(info -- LTO_ENABLE = $(LTO_ENABLE)) + $(info -- DEBUG_MATRIX_SCAN_RATE_ENABLE = $(DEBUG_MATRIX_SCAN_RATE_ENABLE)) + $(info ) endif - -OLED_ENABLE = no # disable OLED in TOP/common_features.mk diff --git a/keyboards/helix/pico/qmk_conf/rules.mk b/keyboards/helix/pico/qmk_conf/rules.mk index e2993b3f80..08ca8e094d 100644 --- a/keyboards/helix/pico/qmk_conf/rules.mk +++ b/keyboards/helix/pico/qmk_conf/rules.mk @@ -1,4 +1,2 @@ EXTRAKEY_ENABLE = yes # Audio control and System control AUDIO_ENABLE = yes # Audio output - -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) diff --git a/keyboards/helix/pico/rules.mk b/keyboards/helix/pico/rules.mk index 12caec37ef..efa7ae4be5 100644 --- a/keyboards/helix/pico/rules.mk +++ b/keyboards/helix/pico/rules.mk @@ -1,6 +1,6 @@ +SPLIT_KEYBOARD = yes + # Helix Spacific Build Options default values -OLED_ENABLE = no # OLED_ENABLE -LOCAL_GLCDFONT = no # use each keymaps "helixfont.h" insted of "common/glcdfont.c" LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) LED_ANIMATIONS = yes # LED animations diff --git a/keyboards/helix/pico/split_util.c b/keyboards/helix/pico/split_util.c deleted file mode 100644 index c77e63f33c..0000000000 --- a/keyboards/helix/pico/split_util.c +++ /dev/null @@ -1,104 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "wait.h" - -#ifdef USE_MATRIX_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -#ifdef EE_HANDS -# include "eeconfig.h" -#endif - -#ifndef SPLIT_USB_TIMEOUT - #define SPLIT_USB_TIMEOUT 2500 -#endif - -volatile bool isLeftHand = true; - -bool waitForUsb(void) { - for (uint8_t i = 0; i < (SPLIT_USB_TIMEOUT / 100); i++) { - // This will return true of a USB connection has been established - if (UDADDR & _BV(ADDEN)) { - return true; - } - wait_ms(100); - } - - // Avoid NO_USB_STARTUP_CHECK - Disable USB as the previous checks seem to enable it somehow - (USBCON &= ~(_BV(USBE) | _BV(OTGPADE))); - - return false; -} - -bool is_keyboard_left(void) { -#if defined(SPLIT_HAND_PIN) - // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand - setPinInput(SPLIT_HAND_PIN); - return readPin(SPLIT_HAND_PIN); -#elif defined(EE_HANDS) - return eeconfig_read_handedness(); -#elif defined(MASTER_RIGHT) - return !is_helix_master(); -#endif - - return is_helix_master(); -} - -bool is_helix_master(void) { - static enum { UNKNOWN, MASTER, SLAVE } usbstate = UNKNOWN; - - // only check once, as this is called often - if (usbstate == UNKNOWN) { -#if defined(SPLIT_USB_DETECT) - usbstate = waitForUsb() ? MASTER : SLAVE; -#elif defined(__AVR__) - USBCON |= (1 << OTGPADE); // enables VBUS pad - wait_us(5); - - usbstate = (USBSTA & (1 << VBUS)) ? MASTER : SLAVE; // checks state of VBUS -#else - usbstate = MASTER; -#endif - } - - return (usbstate == MASTER); - } - -static void keyboard_master_setup(void) { - -#ifdef USE_MATRIX_I2C - i2c_master_init(); -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { - -#ifdef USE_MATRIX_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -void split_keyboard_setup(void) { - isLeftHand = is_keyboard_left(); - - if (is_helix_master()) { - keyboard_master_setup(); - } else { - keyboard_slave_setup(); - } - sei(); -} diff --git a/keyboards/helix/pico/split_util.h b/keyboards/helix/pico/split_util.h deleted file mode 100644 index b839ce6e3e..0000000000 --- a/keyboards/helix/pico/split_util.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool is_helix_master(void); - -void matrix_master_OLED_init (void); From d3584be431871cb636cca95107c956c614684b4d Mon Sep 17 00:00:00 2001 From: Michal Petrik Date: Mon, 21 Feb 2022 18:08:07 +0100 Subject: [PATCH 02/14] [Docs] Update newbs_building_firmware.md (#16333) --- docs/newbs_building_firmware.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/newbs_building_firmware.md b/docs/newbs_building_firmware.md index ed51a9aea5..c4ce9fd9f3 100644 --- a/docs/newbs_building_firmware.md +++ b/docs/newbs_building_firmware.md @@ -1,6 +1,6 @@ # Building Your First Firmware -Now that you have setup your build environment you are ready to start building custom firmware. For this section of the guide we will bounce between 3 programs- your file manager, your text editor, and your terminal window. Keep all 3 open until you are done and happy with your keyboard firmware. +Now that you have set up your build environment you are ready to start building custom firmware. For this section of the guide we will bounce between 3 programs- your file manager, your text editor, and your terminal window. Keep all 3 open until you are done and happy with your keyboard firmware. ## Configure Your Build Environment Defaults (Optional) From b1f86225136247177858203f08e7a3af09c4ad63 Mon Sep 17 00:00:00 2001 From: Michal Petrik Date: Mon, 21 Feb 2022 18:08:36 +0100 Subject: [PATCH 03/14] [Docs] Update feature_leader_key.md (#16344) Co-authored-by: zvecr --- docs/feature_leader_key.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/feature_leader_key.md b/docs/feature_leader_key.md index f10bca7589..e5b1e7a4d9 100644 --- a/docs/feature_leader_key.md +++ b/docs/feature_leader_key.md @@ -37,7 +37,7 @@ void matrix_scan_user(void) { } ``` -As you can see, you have a few function. You can use `SEQ_ONE_KEY` for single-key sequences (Leader followed by just one key), and `SEQ_TWO_KEYS`, `SEQ_THREE_KEYS` up to `SEQ_FIVE_KEYS` for longer sequences. +As you can see, you have a few functions. You can use `SEQ_ONE_KEY` for single-key sequences (Leader followed by just one key), and `SEQ_TWO_KEYS`, `SEQ_THREE_KEYS` up to `SEQ_FIVE_KEYS` for longer sequences. Each of these accepts one or more keycodes as arguments. This is an important point: You can use keycodes from **any layer on your keyboard**. That layer would need to be active for the leader macro to fire, obviously. @@ -74,9 +74,9 @@ SEQ_THREE_KEYS(KC_C, KC_C, KC_C) { ## Infinite Leader key timeout -Sometimes your leader key is not on a comfortable places as the rest of keys on your sequence. Imagine that your leader key is one of your outer top right keys, you may need to reposition your hand just to reach your leader key. +Sometimes your leader key is not on a comfortable place as the rest of keys on your sequence. Imagine that your leader key is one of your outer top right keys, you may need to reposition your hand just to reach your leader key. This can make typing the entire sequence on time hard even if you are able to type most of the sequence fast. For example, if your sequence is `Leader + asd` typing `asd` fast is very easy once you have your hands in your home row. However starting the sequence in time after moving your hand out of the home row to reach the leader key and back is not. -To remove the stress this situation produces to your hands you can enable an infinite timeout just for the leader key. This mean that, after you hit the leader key you will have an infinite amount of time to start the rest of the sequence, allowing you to proper position your hands on the best position to type the rest of the sequence comfortably. +To remove the stress this situation produces to your hands you can enable an infinite timeout just for the leader key. This means that after you hit the leader key you will have an infinite amount of time to start the rest of the sequence, allowing you to proper position your hands on the best position to type the rest of the sequence comfortably. This infinite timeout only affects the leader key, so in our previous example of `Leader + asd` you will have an infinite amount of time between `Leader` and `a`, but once you start the sequence the timeout you have configured (global or per key) will work normally. This way you can configure a very short `LEADER_TIMEOUT` but still have plenty of time to position your hands. @@ -89,11 +89,11 @@ In order to enable this, place this in your `config.h`: By default, the Leader Key feature will filter the keycode out of [`Mod-Tap`](mod_tap.md) and [`Layer Tap`](feature_layers.md#switching-and-toggling-layers) functions when checking for the Leader sequences. That means if you're using `LT(3, KC_A)`, it will pick this up as `KC_A` for the sequence, rather than `LT(3, KC_A)`, giving a more expected behavior for newer users. -While, this may be fine for most, if you want to specify the whole keycode (eg, `LT(3, KC_A)` from the example above) in the sequence, you can enable this by added `#define LEADER_KEY_STRICT_KEY_PROCESSING` to your `config.h` file. This will then disable the filtering, and you'll need to specify the whole keycode. +While, this may be fine for most, if you want to specify the whole keycode (eg, `LT(3, KC_A)` from the example above) in the sequence, you can enable this by adding `#define LEADER_KEY_STRICT_KEY_PROCESSING` to your `config.h` file. This will then disable the filtering, and you'll need to specify the whole keycode. ## Customization -The Leader Key feature has some additional customization to how the Leader Key feature works. It has two functions that can be called at certain parts of the process. Namely `leader_start()` and `leader_end()`. +The Leader Key feature has some additional customization to how the Leader Key feature works. It has two functions that can be called at certain parts of the process. Namely `leader_start()` and `leader_end()`. The `leader_start()` function is called when you tap the `KC_LEAD` key, and the `leader_end()` function is called when either the leader sequence is completed, or the leader timeout is hit. From 249eb871028aaaaf508136088ef25fb67a83b28e Mon Sep 17 00:00:00 2001 From: 66f9e4eae <99080777+66f94eae@users.noreply.github.com> Date: Tue, 22 Feb 2022 01:09:19 +0800 Subject: [PATCH 04/14] [Keyboard] [redox_w] add dvorak layout and white led support (#16259) Co-authored-by: Drashna Jaelre --- keyboards/redox_w/keymaps/dvorak/keymap.c | 128 +++++++++++++++++++++ keyboards/redox_w/keymaps/dvorak/readme.md | 38 ++++++ keyboards/redox_w/redox_w.c | 13 ++- keyboards/redox_w/redox_w.h | 27 +++-- 4 files changed, 188 insertions(+), 18 deletions(-) create mode 100644 keyboards/redox_w/keymaps/dvorak/keymap.c create mode 100644 keyboards/redox_w/keymaps/dvorak/readme.md diff --git a/keyboards/redox_w/keymaps/dvorak/keymap.c b/keyboards/redox_w/keymaps/dvorak/keymap.c new file mode 100644 index 0000000000..f2c2d85f04 --- /dev/null +++ b/keyboards/redox_w/keymaps/dvorak/keymap.c @@ -0,0 +1,128 @@ +/* Copyright 2021 66f94eae(66f94eae@gmail.com) + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +enum layers { + _DVORAK, + _SYMB, + _QWERTY, + _ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_DVORAK] = LAYOUT( +//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GESC ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_BSPC , +//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC, KC_RBRC ,KC_F ,KC_G ,KC_C ,KC_R ,KC_L ,KC_SLSH , +//├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LCTL ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I ,KC_MINS, KC_EQL ,KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,KC_BSLS , +//├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT ,KC_SCLN ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_PGUP ,KC_HOME , KC_END ,KC_PGDN ,KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,KC_RSFT , +//├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_CAPS ,KC_APP ,KC_LALT ,KC_LGUI , LT(3,KC_MUTE), KC_SPC ,KC_INS , KC_DEL ,KC_ENT , KC_RALT , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT +//└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ +), + +[_SYMB] = LAYOUT( +//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GESC ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_BSPC , +//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB , KC_BTN1 ,KC_MS_U ,KC_BTN2 ,KC_WH_U ,KC_COPY ,KC_F6 , KC_F7 ,KC_COPY ,KC_P7 ,KC_P8 ,KC_P9 ,KC_MPRV ,KC_PPLS , +//├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LCTL ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_WH_D ,KC_CUT ,KC_VOLD , KC_VOLU ,KC_CUT ,KC_P4 ,KC_P5 ,KC_P6 ,KC_MNXT ,KC_PMNS , +//├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT ,KC_WH_L ,KC_UP ,KC_WH_R ,KC_LGUI ,KC_PSTE ,KC_WH_U ,KC_SLCK , KC_NLCK ,KC_WH_D ,KC_PSTE ,KC_P1 ,KC_P2 ,KC_P3 ,KC_PEQL ,KC_PAST , +//├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_CAPS ,KC_LEFT ,KC_DOWN ,KC_RGHT, LT(3,KC_MUTE) ,KC_SPC ,KC_ESC , KC_DEL ,KC_ENT , KC_APP , KC_P0 ,KC_PDOT ,KC_PENT ,KC_PSLS +//└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ +), + +[_QWERTY] = LAYOUT( +//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GESC ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_BSPC, +//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_MINS , KC_EQL ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_BSLS , +//├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LCTL ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_LBRC , KC_RBRC ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_QUOT , +//├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_HOME ,KC_PGUP , KC_PGDN ,KC_END ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSFT , +//├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_CAPS ,KC_LGUI ,KC_LALT , KC_APP ,LT(3,KC_MUTE) , KC_SPC ,KC_INS , KC_DEL ,KC_ENT , KC_APP , KC_LEFT ,KC_UP ,KC_DOWN ,KC_RGHT +//└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ +), + +[_ADJUST] = LAYOUT( +//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GESC ,TO(0) ,TO(1) ,TO(2) ,KC_NO ,KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , +//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , +//├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , +//├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_RSFT , +//├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_NO ,KC_NO ,KC_NO ,KC_LGUI ,LT(3,KC_MUTE), KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_APP ,KC_NO ,KC_NO ,KC_NO ,KC_NO +//└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ +) + +}; + +layer_state_t layer_state_set_user(layer_state_t state) +{ + switch (get_highest_layer(state)) { + case _DVORAK: + blu_led_off; + grn_led_off; + break; + case _SYMB: + blu_led_on; + grn_led_off; + break; + case _QWERTY: + blu_led_off; + grn_led_on; + break; + case _ADJUST: + blu_led_on; + grn_led_on; + break; + default: + break; + } + return state; +} + +bool led_update_user(led_t led_state) +{ + if (led_state.caps_lock) { + red_led_on; + } else { + red_led_off; + } + if (led_state.num_lock) { + wht_led_on; + } else { + wht_led_off; + } + return false; +} diff --git a/keyboards/redox_w/keymaps/dvorak/readme.md b/keyboards/redox_w/keymaps/dvorak/readme.md new file mode 100644 index 0000000000..cdc90976a7 --- /dev/null +++ b/keyboards/redox_w/keymaps/dvorak/readme.md @@ -0,0 +1,38 @@ +### fork from default layout,and support dvorak layout[defalut layer] + +##### only use 3 layers + +``` +Keymap: 3 Layers +----------------- +stack of layers + ____________ precedence + / / | high + 31 /___________// | + : _:_:_:_:_:__ | + 3 /___________// | --- adjust + 2 /___________// | --- qwerty + 1 /___________// | --- symb + 0 /___________/ | --- dvorak[default] +``` + +defalut LED indicators + +RED --------- CAPS LOCK + +BLUE ------- SYMB layer + +GREEN----- QWERTY layer + +WHITE------ NUM LOCK *in my test case,this is inefficient on mac os* + +> BLUE and GREEN as a bit flag +> +> 0                    0 + +| BLUE(0) | GREEN(0) | STATUS | DESCRIBE | +|:-------:|:--------:|:------:|:--------------------------------------------------- | +| 0 | 0 | 0 | layer 0[dvorak] is active,and blue,green led is off | +| 1 | 0 | 1 | layer1[symb] is active, and blue led is on | +| 0 | 1 | 2 | layer 2[qwerty] is active,and green led is on | +| 1 | 1 | 3 | layer 3[adjust] is active,and blue,green led is on | diff --git a/keyboards/redox_w/redox_w.c b/keyboards/redox_w/redox_w.c index 5b86344536..48ea7d3bed 100644 --- a/keyboards/redox_w/redox_w.c +++ b/keyboards/redox_w/redox_w.c @@ -1,10 +1,15 @@ #include "redox_w.h" void led_init(void) { - DDRD |= (1<<1); - PORTD |= (1<<1); - DDRF |= (1<<4) | (1<<5); - PORTF |= (1<<4) | (1<<5); + setPinOutput(D0); + setPinOutput(D1); + setPinOutput(F4); + setPinOutput(F5); + + writePinHigh(D0); + writePinHigh(D1); + writePinHigh(F4); + writePinHigh(F5); } diff --git a/keyboards/redox_w/redox_w.h b/keyboards/redox_w/redox_w.h index 727c3050dc..1ed42c8458 100644 --- a/keyboards/redox_w/redox_w.h +++ b/keyboards/redox_w/redox_w.h @@ -2,21 +2,20 @@ #include "quantum.h" -#define red_led_off PORTF |= (1<<5) -#define red_led_on PORTF &= ~(1<<5) -#define blu_led_off PORTF |= (1<<4) -#define blu_led_on PORTF &= ~(1<<4) -#define grn_led_off PORTD |= (1<<1) -#define grn_led_on PORTD &= ~(1<<1) +#define red_led_off writePinHigh(F5) +#define red_led_on writePinLow(F5) +#define blu_led_off writePinHigh(F4) +#define blu_led_on writePinLow(F4) +#define grn_led_off writePinHigh(D1) +#define grn_led_on writePinLow(D1) +#define wht_led_off writePinHigh(D0) +#define wht_led_on writePinLow(D0) -#define set_led_off red_led_off; grn_led_off; blu_led_off -#define set_led_red red_led_on; grn_led_off; blu_led_off -#define set_led_blue red_led_off; grn_led_off; blu_led_on -#define set_led_green red_led_off; grn_led_on; blu_led_off -#define set_led_yellow red_led_on; grn_led_on; blu_led_off -#define set_led_magenta red_led_on; grn_led_off; blu_led_on -#define set_led_cyan red_led_off; grn_led_on; blu_led_on -#define set_led_white red_led_on; grn_led_on; blu_led_on +#define set_led_off red_led_off; grn_led_off; blu_led_off; wht_led_off +#define set_led_red red_led_on; grn_led_off; blu_led_off; wht_led_off +#define set_led_blue red_led_off; grn_led_off; blu_led_on; wht_led_off +#define set_led_green red_led_off; grn_led_on; blu_led_off; wht_led_off +#define set_led_white red_led_off; grn_led_off; blu_led_off; wht_led_on // This a shortcut to help you visually see your layout. // The first section contains all of the arguements From 7fb22706fdb41030bff7fc1bf480d8b002ec86c5 Mon Sep 17 00:00:00 2001 From: Wolf Van Herreweghe Date: Mon, 21 Feb 2022 18:10:06 +0100 Subject: [PATCH 05/14] [Keyboard] Add sabre (#15964) Co-authored-by: Wolf Van Herreweghe --- keyboards/wolf/sabre/config.h | 61 +++++++++++++++++++ keyboards/wolf/sabre/info.json | 10 +++ keyboards/wolf/sabre/keymaps/default/keymap.c | 41 +++++++++++++ keyboards/wolf/sabre/keymaps/via/keymap.c | 61 +++++++++++++++++++ keyboards/wolf/sabre/keymaps/via/rules.mk | 1 + keyboards/wolf/sabre/readme.md | 21 +++++++ keyboards/wolf/sabre/rules.mk | 23 +++++++ keyboards/wolf/sabre/sabre.c | 14 +++++ keyboards/wolf/sabre/sabre.h | 40 ++++++++++++ 9 files changed, 272 insertions(+) create mode 100644 keyboards/wolf/sabre/config.h create mode 100644 keyboards/wolf/sabre/info.json create mode 100644 keyboards/wolf/sabre/keymaps/default/keymap.c create mode 100644 keyboards/wolf/sabre/keymaps/via/keymap.c create mode 100644 keyboards/wolf/sabre/keymaps/via/rules.mk create mode 100644 keyboards/wolf/sabre/readme.md create mode 100644 keyboards/wolf/sabre/rules.mk create mode 100644 keyboards/wolf/sabre/sabre.c create mode 100644 keyboards/wolf/sabre/sabre.h diff --git a/keyboards/wolf/sabre/config.h b/keyboards/wolf/sabre/config.h new file mode 100644 index 0000000000..02b897ba4f --- /dev/null +++ b/keyboards/wolf/sabre/config.h @@ -0,0 +1,61 @@ +/* +Copyright 2020 + +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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x5453 // TS - ToastyStoemp +#define PRODUCT_ID 0x0055 // Sabre +#define DEVICE_VER 0x0001 // Version 1 +#define MANUFACTURER ToastyStoemp +#define PRODUCT Sabre + +/* key matrix size */ +#define MATRIX_ROWS 12 +#define MATRIX_COLS 9 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ + +// Checked with Eagle Schematic +#define MATRIX_ROW_PINS { D0, D1, F1, F0, B5, B6, C7, C6, F6, F7, F4, F5 } +#define MATRIX_COL_PINS { D2, D3, D5, D4, D6, D7, B4, B2, B1 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +#define BACKLIGHT_PIN B7 + +#define LED_CAPS_LOCK_PIN B3 +#define LED_SCROLL_LOCK_PIN B0 + +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/keyboards/wolf/sabre/info.json b/keyboards/wolf/sabre/info.json new file mode 100644 index 0000000000..3fb912fdb4 --- /dev/null +++ b/keyboards/wolf/sabre/info.json @@ -0,0 +1,10 @@ +{ + "keyboard_name": "Sabre", + "url": "", + "maintainer": "ToastyStoemp", + "layouts": { + "LAYOUT": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":8.25, "y":0}, {"label":"PrtSc", "x":17.25, "y":0}, {"label":"Scroll Lock", "x":18.25, "y":0}, {"label":"Pause", "x":19.25, "y":0}, {"label":"\u00ac", "x":0, "y":1.25}, {"label":"!", "x":1, "y":1.25}, {"label":"\"", "x":2, "y":1.25}, {"label":"\u00a3", "x":3, "y":1.25}, {"label":"$", "x":4, "y":1.25}, {"label":"%", "x":5, "y":1.25}, {"label":"^", "x":6, "y":1.25}, {"label":"Insert", "x":17.25, "y":1.25}, {"label":"Home", "x":18.25, "y":1.25}, {"label":"PgUp", "x":19.25, "y":1.25}, {"label":"Tab", "x":0, "y":2.25, "w":1.5}, {"label":"Q", "x":1.5, "y":2.25}, {"label":"W", "x":2.5, "y":2.25}, {"label":"E", "x":3.5, "y":2.25}, {"label":"R", "x":4.5, "y":2.25}, {"label":"T", "x":5.5, "y":2.25}, {"label":"Delete", "x":17.25, "y":2.25}, {"label":"End", "x":18.25, "y":2.25}, {"label":"PgDn", "x":19.25, "y":2.25}, {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, {"label":"A", "x":1.75, "y":3.25}, {"label":"S", "x":2.75, "y":3.25}, {"label":"D", "x":3.75, "y":3.25}, {"label":"F", "x":4.75, "y":3.25}, {"label":"G", "x":5.75, "y":3.25}, {"label":"Shift", "x":0, "y":4.25, "w":2.25}, {"label":"Z", "x":2.25, "y":4.25}, {"label":"X", "x":3.25, "y":4.25}, {"label":"C", "x":4.25, "y":4.25}, {"label":"V", "x":5.25, "y":4.25}, {"label":"B", "x":6.25, "y":4.25}, {"label":"\u2191", "x":18.25, "y":4.25}, {"label":"Ctrl", "x":0, "y":5.25, "w":1.5}, {"label":"Win", "x":2.5, "y":5.25, "w":1.5}, {"label":"Alt", "x":4, "y":5.25}, {"x":5, "y":5.25, "w":2.25}, {"label":"\u2190", "x":17.25, "y":5.25}, {"label":"\u2193", "x":18.25, "y":5.25}, {"label":"\u2192", "x":19.25, "y":5.25}, {"label":"F6", "x":-7.75, "y":6.25}, {"label":"F7", "x":-6.75, "y":6.25}, {"label":"F8", "x":-5.75, "y":6.25}, {"label":"F9", "x":-4.5, "y":6.25}, {"label":"F10", "x":-3.5, "y":6.25}, {"label":"F11", "x":-2.5, "y":6.25}, {"label":"F12", "x":-1.5, "y":6.25}, {"label":"&", "x":-8.5, "y":7.5}, {"label":"*", "x":-7.5, "y":7.5}, {"label":"(", "x":-6.5, "y":7.5}, {"label":")", "x":-5.5, "y":7.5}, {"label":"_", "x":-4.5, "y":7.5}, {"label":"+", "x":-3.5, "y":7.5}, {"label":"BackSpace", "x":-2.5, "y":7.5, "w":2}, {"label":"Y", "x":-9.0, "y":8.5}, {"label":"U", "x":-8, "y":8.5}, {"label":"I", "x":-7.0, "y":8.5}, {"label":"O", "x":-6, "y":8.5}, {"label":"P", "x":-5.0, "y":8.5}, {"label":"{", "x":-4, "y":8.5}, {"label":"}", "x":-3.0, "y":8.5}, {"label":"|", "x":-2, "y":8.5, "w":1.5}, {"label":"H", "x":-8.75, "y":9.5}, {"label":"J", "x":-7.75, "y":9.5}, {"label":"K", "x":-6.75, "y":9.5}, {"label":"L", "x":-5.75, "y":9.5}, {"label":":", "x":-4.75, "y":9.5}, {"label":"@", "x":-3.75, "y":9.5}, {"label":"Enter", "x":-2.75, "y":9.5, "w":2.25}, {"label":"B", "x":-9.25, "y":10.5}, {"label":"N", "x":-8.25, "y":10.5}, {"label":"M", "x":-7.25, "y":10.5}, {"label":"<", "x":-6.25, "y":10.5}, {"label":">", "x":-5.25, "y":10.5}, {"label":"?", "x":-4.25, "y":10.5}, {"label":"Shift", "x":-3.25, "y":10.5, "w":1.75}, {"x":-1.5, "y":10.5}, {"x":-9.25, "y":11.5, "w":2.75}, {"label":"<", "x":-6.5, "y":11.5}, {"label":"Alt", "x":-5.5, "y":11.5, "w":1.5}, {"label":"Ctrl", "x":-3.0, "y":11.5, "w":1.5}] + } + } +} \ No newline at end of file diff --git a/keyboards/wolf/sabre/keymaps/default/keymap.c b/keyboards/wolf/sabre/keymaps/default/keymap.c new file mode 100644 index 0000000000..a873ab89fb --- /dev/null +++ b/keyboards/wolf/sabre/keymaps/default/keymap.c @@ -0,0 +1,41 @@ +/* +Copyright 2020 +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 . +*/ + +#include QMK_KEYBOARD_H + +enum layers { + _LAYER0, + _LAYER1 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_LAYER0] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RCTRL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_LAYER1] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_INC, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_TOGG, BL_DEC, BL_BRTG + ) +}; diff --git a/keyboards/wolf/sabre/keymaps/via/keymap.c b/keyboards/wolf/sabre/keymaps/via/keymap.c new file mode 100644 index 0000000000..6a6c35bb0e --- /dev/null +++ b/keyboards/wolf/sabre/keymaps/via/keymap.c @@ -0,0 +1,61 @@ +/* +Copyright 2020 +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 . +*/ + +#include QMK_KEYBOARD_H + +enum layers { + _LAYER0, + _LAYER1, + _LAYER2, + _LAYER3 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_LAYER0] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RCTRL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_LAYER1] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_INC, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_TOGG, BL_DEC, BL_BRTG + ), + + [_LAYER2] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [_LAYER3] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; diff --git a/keyboards/wolf/sabre/keymaps/via/rules.mk b/keyboards/wolf/sabre/keymaps/via/rules.mk new file mode 100644 index 0000000000..1e5b99807c --- /dev/null +++ b/keyboards/wolf/sabre/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes diff --git a/keyboards/wolf/sabre/readme.md b/keyboards/wolf/sabre/readme.md new file mode 100644 index 0000000000..b06217d0ee --- /dev/null +++ b/keyboards/wolf/sabre/readme.md @@ -0,0 +1,21 @@ +# Sabre + +The following is the QMK Firmware for the Sabre PCB. + +The PCB features: +* QMK & VIA compatibility + +--- + +* Keyboard Maintainer: [ToastyStoemp](https://github.com/ToastyStoemp) + +Make example for this keyboard (after setting up your build environment): + + make wolf/sabre:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Bootloader Enter the bootloader in 3 ways: +* **Bootmagic reset**: Hold down the key ESC key and plug in the keyboard (Top Left most switch) +* **Physical reset button**: Briefly press the button on the back of the PCB +* **Keycode in layout**: Press the B key on layer 1 which is mapped to `RESET` diff --git a/keyboards/wolf/sabre/rules.mk b/keyboards/wolf/sabre/rules.mk new file mode 100644 index 0000000000..39ad4aa5a0 --- /dev/null +++ b/keyboards/wolf/sabre/rules.mk @@ -0,0 +1,23 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency +F_CPU = 8000000 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +BACKLIGHT_ENABLE = yes +BACKLIGHT_DRIVER = pwm \ No newline at end of file diff --git a/keyboards/wolf/sabre/sabre.c b/keyboards/wolf/sabre/sabre.c new file mode 100644 index 0000000000..84577ef867 --- /dev/null +++ b/keyboards/wolf/sabre/sabre.c @@ -0,0 +1,14 @@ +/* +Copyright 2020 +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 . +*/ +#include "sabre.h" diff --git a/keyboards/wolf/sabre/sabre.h b/keyboards/wolf/sabre/sabre.h new file mode 100644 index 0000000000..4580f46e93 --- /dev/null +++ b/keyboards/wolf/sabre/sabre.h @@ -0,0 +1,40 @@ +/* +Copyright 2020 +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 . +*/ + +#pragma once + +#include "quantum.h" + +/* sabre Keymap Definitions */ +#define LAYOUT( \ + K00, K01, K11, K02, K12, K13, K04, K14, K05, K15, K06, K16, K07, K17, K08, K18, \ + K20, K30, K21, K31, K22, K32, K23, K33, K24, K34, K25, K35, K26, K36, K37, K28, K38, \ + K40, K50, K41, K51, K42, K52, K43, K53, K44, K54, K45, K55, K46, K56, K57, K48, K58, \ + K60, K70, K61, K71, K62, K72, K63, K73, K64, K74, K65, K75, K76, \ + K80, K90, K81, K91, K82, K92, K83, K93, K84, K94, K85, K95, K86, K96, K88, \ + KA0, KB0, KA1, KA2, KB3, KB4, KA5, KA6, KB7, KA8, KB8 \ +) { \ + { K00, K01, K02, KC_NO, K04, K05, K06, K07, K08 }, \ + { KC_NO, K11, K12, K13, K14, K15, K16, K17, K18 }, \ + { K20, K21, K22, K23, K24, K25, K26, KC_NO, K28 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38 }, \ + { K40, K41, K42, K43, K44, K45, K46, KC_NO, K48 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \ + { K60, K61, K62, K63, K64, K65, KC_NO, KC_NO, KC_NO }, \ + { K70, K71, K72, K73, K74, K75, K76, KC_NO, KC_NO }, \ + { K80, K81, K82, K83, K84, K85, K86, KC_NO, K88 }, \ + { K90, K91, K92, K93, K94, K95, K96, KC_NO, KC_NO }, \ + { KA0, KA1, KA2, KC_NO, KC_NO, KA5, KA6, KC_NO, KA8 }, \ + { KB0, KC_NO, KC_NO, KB3, KB4, KC_NO, KC_NO, KB7, KB8 } \ +} From 59f671744b7474cdc07830799053ba1d61edbf72 Mon Sep 17 00:00:00 2001 From: peepeetee <43021794+peepeetee@users.noreply.github.com> Date: Tue, 22 Feb 2022 01:10:19 +0800 Subject: [PATCH 06/14] [Keyboard] ID75 v2 (#16351) --- keyboards/idobao/id75/v2/config.h | 152 +++++++++++++++++++++++++++++ keyboards/idobao/id75/v2/info.json | 10 ++ keyboards/idobao/id75/v2/readme.md | 27 +++++ keyboards/idobao/id75/v2/rules.mk | 24 +++++ keyboards/idobao/id75/v2/v2.c | 49 ++++++++++ keyboards/idobao/id75/v2/v2.h | 41 ++++++++ 6 files changed, 303 insertions(+) create mode 100644 keyboards/idobao/id75/v2/config.h create mode 100644 keyboards/idobao/id75/v2/info.json create mode 100644 keyboards/idobao/id75/v2/readme.md create mode 100644 keyboards/idobao/id75/v2/rules.mk create mode 100644 keyboards/idobao/id75/v2/v2.c create mode 100644 keyboards/idobao/id75/v2/v2.h diff --git a/keyboards/idobao/id75/v2/config.h b/keyboards/idobao/id75/v2/config.h new file mode 100644 index 0000000000..c2b64649cb --- /dev/null +++ b/keyboards/idobao/id75/v2/config.h @@ -0,0 +1,152 @@ +/* Copyright 2022 peepeetee + * + * 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 . + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x6964 // ID +#define PRODUCT_ID 0x0075 +#define DEVICE_VER 0x0002 +#define MANUFACTURER IDOBAO +#define PRODUCT ID75 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B0, B3, C7, B6, C6 } +#define MATRIX_COL_PINS { F6, F5, F4, F1, E6, D5, D3, D2, D1, D0, D4, D6, D7, B4, B5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#undef RGB_DI_PIN +#define RGB_DI_PIN F0 +#ifdef RGB_MATRIX_ENABLE +# define DRIVER_LED_TOTAL 85 /* 10 Bottom 75 top*/ +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +# define RGB_MATRIX_FRAMEBUFFER_EFFECTS +# define RGB_MATRIX_KEYPRESSES +# define ENABLE_RGB_MATRIX_ALPHAS_MODS +# define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +# define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +# define ENABLE_RGB_MATRIX_BREATHING +# define ENABLE_RGB_MATRIX_BAND_SAT +# define ENABLE_RGB_MATRIX_BAND_VAL +# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +# define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +# define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +# define ENABLE_RGB_MATRIX_CYCLE_ALL +# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +# define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +# define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +# define ENABLE_RGB_MATRIX_TYPING_HEATMAP +# define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only if RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +# define ENABLE_RGB_MATRIX_SPLASH +# define ENABLE_RGB_MATRIX_MULTISPLASH +# define ENABLE_RGB_MATRIX_SOLID_SPLASH +# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* Bootmagic Lite key configuration */ +#define BOOTMAGIC_LITE_ROW 0 +#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/idobao/id75/v2/info.json b/keyboards/idobao/id75/v2/info.json new file mode 100644 index 0000000000..fe24920f81 --- /dev/null +++ b/keyboards/idobao/id75/v2/info.json @@ -0,0 +1,10 @@ +{ + "keyboard_name": "idobao/id75/v2", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT_ortho_5x15": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":13, "y":2}, {"x":14, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4}, {"x":6, "y":4}, {"x":7, "y":4}, {"x":8, "y":4}, {"x":9, "y":4}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}] + } + } +} diff --git a/keyboards/idobao/id75/v2/readme.md b/keyboards/idobao/id75/v2/readme.md new file mode 100644 index 0000000000..76a94ae38c --- /dev/null +++ b/keyboards/idobao/id75/v2/readme.md @@ -0,0 +1,27 @@ +# ID75 v2 + +![ID75 v2](https://i.imgur.com/KdAjS5f.jpg) + +A 5x15 ortholinear keyboard with hotswap sockets and north facing in switch RGB LEDs and RGB underglow + +* Keyboard Maintainer: [peepeetee](https://github.com/peepeetee) +* Hardware Supported: ID75 v2 +* Hardware Availability: https://idobao.net/products/idobao-id75-crystal-hot-swap-keyboard-kit?_pos=1&_sid=8758d3561&_ss=r + +Make example for this keyboard (after setting up your build environment): + + make idobao/id75/v2:default + +Flashing example for this keyboard: + + make idobao/id75/v2:default:flash + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Bootloader + +Enter the bootloader in 3 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +* **Physical reset button**: Briefly press the button on the back of the PCB +* **Keycode in layout**: Press the key mapped to `RESET` if it is available diff --git a/keyboards/idobao/id75/v2/rules.mk b/keyboards/idobao/id75/v2/rules.mk new file mode 100644 index 0000000000..303a814c3a --- /dev/null +++ b/keyboards/idobao/id75/v2/rules.mk @@ -0,0 +1,24 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +LTO_ENABLE = yes # Use link time optimization + +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = WS2812 + +LAYOUTS = ortho_5x15 diff --git a/keyboards/idobao/id75/v2/v2.c b/keyboards/idobao/id75/v2/v2.c new file mode 100644 index 0000000000..f65a9e3362 --- /dev/null +++ b/keyboards/idobao/id75/v2/v2.c @@ -0,0 +1,49 @@ +/* Copyright 2022 peepeetee + * + * 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 . + */ +#include "v2.h" + +#ifdef RGB_MATRIX_ENABLE +led_config_t g_led_config = { { + // Key Matrix to LED Index +{ 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70 }, +{ 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55 }, +{ 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40 }, +{ 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25 }, +{ 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10 } +}, { + // LED Index to Physical Position +{8, 12},{60, 12},{112, 12},{164, 12},{216, 12}, +{216, 60},{164, 60},{112, 60},{60, 60},{8, 60}, + + +{224, 64}, {208, 64}, {192, 64}, {176, 64}, {160, 64}, {144, 64}, {128, 64}, {112, 64}, {96, 64}, {80, 64}, {64, 64}, {48, 64}, {32, 64}, {16, 64}, {0, 64}, +{224, 48}, {208, 48}, {192, 48}, {176, 48}, {160, 48}, {144, 48}, {128, 48}, {112, 48}, {96, 48}, {80, 48}, {64, 48}, {48, 48}, {32, 48}, {16, 48}, {0, 48}, +{224, 32}, {208, 32}, {192, 32}, {176, 32}, {160, 32}, {144, 32}, {128, 32}, {112, 32}, {96, 32}, {80, 32}, {64, 32}, {48, 32}, {32, 32}, {16, 32}, {0, 32}, +{224, 16}, {208, 16}, {192, 16}, {176, 16}, {160, 16}, {144, 16}, {128, 16}, {112, 16}, {96, 16}, {80, 16}, {64, 16}, {48, 16}, {32, 16}, {16, 16}, {0, 16}, +{224, 0}, {208, 0}, {192, 0}, {176, 0}, {160, 0}, {144, 0}, {128, 0}, {112, 0}, {96, 0}, {80, 0}, {64, 0}, {48, 0}, {32, 0}, {16, 0}, {0, 0}, + +}, { + // LED Index to Flag +2,2,2,2,2,2,2,2,2,2, +4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, +4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + +} }; + +#endif diff --git a/keyboards/idobao/id75/v2/v2.h b/keyboards/idobao/id75/v2/v2.h new file mode 100644 index 0000000000..9643a1efd3 --- /dev/null +++ b/keyboards/idobao/id75/v2/v2.h @@ -0,0 +1,41 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ + +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_ortho_5x15( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E } \ +} From 7e4f74d6897c5c34be084317a3647f974fdd4e71 Mon Sep 17 00:00:00 2001 From: takashicompany Date: Tue, 22 Feb 2022 02:11:00 +0900 Subject: [PATCH 07/14] [Keyboard] Update Heavy Left (#16354) --- keyboards/takashicompany/heavy_left/config.h | 2 + .../keymaps/takashicompany/keymap.c | 69 +++++++++++++++++++ .../keymaps/takashicompany/rules.mk | 1 + keyboards/takashicompany/heavy_left/rules.mk | 2 +- 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 keyboards/takashicompany/heavy_left/keymaps/takashicompany/keymap.c create mode 100644 keyboards/takashicompany/heavy_left/keymaps/takashicompany/rules.mk diff --git a/keyboards/takashicompany/heavy_left/config.h b/keyboards/takashicompany/heavy_left/config.h index e7f37f251c..b5a16def68 100644 --- a/keyboards/takashicompany/heavy_left/config.h +++ b/keyboards/takashicompany/heavy_left/config.h @@ -143,3 +143,5 @@ along with this program. If not, see . /* Bootmagic Lite key configuration */ //#define BOOTMAGIC_LITE_ROW 0 //#define BOOTMAGIC_LITE_COLUMN 0 + +#define EE_HANDS \ No newline at end of file diff --git a/keyboards/takashicompany/heavy_left/keymaps/takashicompany/keymap.c b/keyboards/takashicompany/heavy_left/keymaps/takashicompany/keymap.c new file mode 100644 index 0000000000..11beb28ca0 --- /dev/null +++ b/keyboards/takashicompany/heavy_left/keymaps/takashicompany/keymap.c @@ -0,0 +1,69 @@ +/* Copyright 2021 takashicompany + * + * 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 . + */ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + KC_00 = USER00, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_JYEN, KC_BSPC, KC_DEL, + KC_P7, KC_P8, KC_P9, KC_PPLS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_ENT, KC_HOME, + KC_P4, KC_P5, KC_P6, KC_PCMM,KC_LCTL, KC_A, KC_S, LT(2, KC_D), KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_END, + KC_P1, KC_P2, KC_P3, KC_PEQL, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, JP_BSLS, KC_UP, KC_RSFT, KC_PGUP, + KC_P0, KC_00, KC_PDOT, KC_PENT, KC_LCTL, KC_LGUI, KC_LALT, LALT_T(KC_LANG2), LALT_T(KC_LANG2), LSFT_T(KC_TAB), KC_SPC, LT(1, KC_LANG1), KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, MO(3) + ), + + LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_EQL, KC_LBRC, KC_SLSH, KC_MINS, KC_RO, KC_SCLN, KC_QUOT, KC_RBRC, KC_NUHS, KC_JYEN, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + LAYOUT( + KC_NLCK, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_M_K, RGB_M_X, RGB_M_G, RGB_M_T, RGB_M_T, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_CAPS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_00: + if (record->event.pressed) { + SEND_STRING("00"); + } + return false; + } + return true; +} \ No newline at end of file diff --git a/keyboards/takashicompany/heavy_left/keymaps/takashicompany/rules.mk b/keyboards/takashicompany/heavy_left/keymaps/takashicompany/rules.mk new file mode 100644 index 0000000000..036bd6d1c3 --- /dev/null +++ b/keyboards/takashicompany/heavy_left/keymaps/takashicompany/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes \ No newline at end of file diff --git a/keyboards/takashicompany/heavy_left/rules.mk b/keyboards/takashicompany/heavy_left/rules.mk index a92a794ed6..ce3c5bfaeb 100644 --- a/keyboards/takashicompany/heavy_left/rules.mk +++ b/keyboards/takashicompany/heavy_left/rules.mk @@ -14,7 +14,7 @@ CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output SPLIT_KEYBOARD=yes \ No newline at end of file From 0b21fbc37b784db576adfa46aea6ef7237c7b62e Mon Sep 17 00:00:00 2001 From: evanmcook <42785294+evanmcook@users.noreply.github.com> Date: Mon, 21 Feb 2022 12:11:23 -0500 Subject: [PATCH 08/14] [Keyboard] add evancookaudio sleepingdinosaur (#16320) Co-authored-by: Joel Challis --- .../evancookaudio/sleepingdinosaur/config.h | 44 +++++++++++++++++++ .../evancookaudio/sleepingdinosaur/info.json | 44 +++++++++++++++++++ .../sleepingdinosaur/keymaps/default/keymap.c | 40 +++++++++++++++++ .../evancookaudio/sleepingdinosaur/readme.md | 17 +++++++ .../evancookaudio/sleepingdinosaur/rules.mk | 18 ++++++++ .../sleepingdinosaur/sleepingdinosaur.c | 17 +++++++ .../sleepingdinosaur/sleepingdinosaur.h | 41 +++++++++++++++++ 7 files changed, 221 insertions(+) create mode 100644 keyboards/evancookaudio/sleepingdinosaur/config.h create mode 100644 keyboards/evancookaudio/sleepingdinosaur/info.json create mode 100644 keyboards/evancookaudio/sleepingdinosaur/keymaps/default/keymap.c create mode 100644 keyboards/evancookaudio/sleepingdinosaur/readme.md create mode 100644 keyboards/evancookaudio/sleepingdinosaur/rules.mk create mode 100644 keyboards/evancookaudio/sleepingdinosaur/sleepingdinosaur.c create mode 100644 keyboards/evancookaudio/sleepingdinosaur/sleepingdinosaur.h diff --git a/keyboards/evancookaudio/sleepingdinosaur/config.h b/keyboards/evancookaudio/sleepingdinosaur/config.h new file mode 100644 index 0000000000..4412e9eb60 --- /dev/null +++ b/keyboards/evancookaudio/sleepingdinosaur/config.h @@ -0,0 +1,44 @@ +/* Copyright 2022 evan cook + * + * 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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x636F +#define PRODUCT_ID 0x0002 +#define DEVICE_VER 0x0000 +#define MANUFACTURER evancook.audio +#define PRODUCT sleepingdinosaur + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 6 + +/* key matrix pins */ + +#define MATRIX_ROW_PINS {D0, D1, D4, C6, D7} +#define MATRIX_COL_PINS {F4, F5, F6, F7, B1, B3} + +#define UNUSED_PINS {B2, B6, B7, D5, C7, F1, F0, B4, E6} + diff --git a/keyboards/evancookaudio/sleepingdinosaur/info.json b/keyboards/evancookaudio/sleepingdinosaur/info.json new file mode 100644 index 0000000000..2c21777d49 --- /dev/null +++ b/keyboards/evancookaudio/sleepingdinosaur/info.json @@ -0,0 +1,44 @@ +{ + "keyboard_name": "evancook.audio sleepingdinosaur", + "url": "https://evancook.audio/", + "maintainer": "evanmcook", + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"1", "x":0, "y":0}, + {"label":"2", "x":1, "y":0}, + {"label":"3", "x":2, "y":0}, + {"label":"4", "x":3, "y":0}, + {"label":"5", "x":4, "y":0}, + {"label":"-", "x":5, "y":0}, + + {"label":"6", "x":0, "y":1}, + {"label":"7", "x":1, "y":1}, + {"label":"8", "x":2, "y":1}, + {"label":"9", "x":3, "y":1}, + {"label":"0", "x":4, "y":1}, + {"label":"R", "x":5, "y":1}, + + {"label":"/", "x":0, "y":2}, + {"label":"Q", "x":1, "y":2}, + {"label":"W", "x":2, "y":2}, + {"label":"E", "x":3, "y":2}, + {"label":"U", "x":4, "y":2}, + {"label":"V", "x":5, "y":2}, + + {"label":"Enter", "x":0, "y":3, "h":2}, + {"label":"A", "x":1, "y":3}, + {"label":"S", "x":2, "y":3}, + {"label":"D", "x":3, "y":3}, + {"label":"Space", "x":4, "y":3, "h":2}, + {"label":"O", "x":5, "y":3}, + + {"label":"Z", "x":1, "y":4}, + {"label":"X", "x":2, "y":4}, + {"label":"C", "x":3, "y":4}, + {"label":"N", "x":5, "y":4} + + ] + } + } +} \ No newline at end of file diff --git a/keyboards/evancookaudio/sleepingdinosaur/keymaps/default/keymap.c b/keyboards/evancookaudio/sleepingdinosaur/keymaps/default/keymap.c new file mode 100644 index 0000000000..94cbc390df --- /dev/null +++ b/keyboards/evancookaudio/sleepingdinosaur/keymaps/default/keymap.c @@ -0,0 +1,40 @@ +/* Copyright 2022 evan cook + * + * 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 . +*/ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* LAYER 0 + * ,-----------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | - | + * |-------+-------+-------|-------|-------|-------| + * | 6 | 7 | 8 | 9 | 0 | R | + * |-------+-------+-------|-------|-------|-------| + * | / | Q | W | E | U | V | + * -------+-------+-------|-------|-------|-------| + * | ENTER | A | S | D | SPACE | O | + * | |-------+-------+-------| |-------| + * | | Z | X | C | | N | + * ,-----------------------------------------------. + */ +[0] = LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, + KC_6, KC_7, KC_8, KC_9, KC_0, KC_R, + KC_SLSH, KC_Q, KC_W, KC_E, KC_U, KC_V, + KC_ENT, KC_A, KC_S, KC_D, KC_SPC, KC_O, + KC_Z, KC_X, KC_C, KC_N +) +}; diff --git a/keyboards/evancookaudio/sleepingdinosaur/readme.md b/keyboards/evancookaudio/sleepingdinosaur/readme.md new file mode 100644 index 0000000000..064e4981fe --- /dev/null +++ b/keyboards/evancookaudio/sleepingdinosaur/readme.md @@ -0,0 +1,17 @@ +# tenpad macropad + +A 28 button macropad, in a format that is closest to a 5x6 grid, designed by evan cook +[Default Layout](https://raw.githubusercontent.com/evanmcook/sleepingdinosaur/main/images/layouts/sleepingdinosaurdefault.jpg) + +* Keyboard Maintainer: [evan cook](https://github.com/evanmcook/) +* Hardware Supported: sleepingdinosaur Macropad PCB +* Hardware Availability: [tenpad Github](https://github.com/evanmcook/sleepingdinosaur) + +Make example for this keyboard (after setting up your build environment): + + make evancookaudio/sleepingdinosaur:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Enter the bootloader: +* **Physical reset button**: On the underside of the board, near the USB connector and microcontroller, press and hold the small button labeled reset for more than one second to enter the bootloader. \ No newline at end of file diff --git a/keyboards/evancookaudio/sleepingdinosaur/rules.mk b/keyboards/evancookaudio/sleepingdinosaur/rules.mk new file mode 100644 index 0000000000..6cf6d9358b --- /dev/null +++ b/keyboards/evancookaudio/sleepingdinosaur/rules.mk @@ -0,0 +1,18 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = caterina + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = no # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output diff --git a/keyboards/evancookaudio/sleepingdinosaur/sleepingdinosaur.c b/keyboards/evancookaudio/sleepingdinosaur/sleepingdinosaur.c new file mode 100644 index 0000000000..814275e3f0 --- /dev/null +++ b/keyboards/evancookaudio/sleepingdinosaur/sleepingdinosaur.c @@ -0,0 +1,17 @@ +/* Copyright 2022 evan cook + * + * 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 . + * +*/ +#include "sleepingdinosaur.h" diff --git a/keyboards/evancookaudio/sleepingdinosaur/sleepingdinosaur.h b/keyboards/evancookaudio/sleepingdinosaur/sleepingdinosaur.h new file mode 100644 index 0000000000..9672fca289 --- /dev/null +++ b/keyboards/evancookaudio/sleepingdinosaur/sleepingdinosaur.h @@ -0,0 +1,41 @@ +/* Copyright 2022 evan cook + * + * 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 . +*/ +#pragma once + +#include "quantum.h" + +/* This is a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT(\ + k00, k01, k02, k03, k04, k05, \ + k06, k07, k08, k09, k10, k11, \ + k12, k13, k14, k15, k16, k17, \ + k18, k19, k20, k21, k22, k23, \ + k24, k25, k26, k27 \ + ) \ + { \ + {k00, k01, k02, k03, k04, k05},\ + {k06, k07, k08, k09, k10, k11},\ + {k12, k13, k14, k15, k16, k17},\ + {k18, k19, k20, k21, k22, k23},\ + {KC_NO, k24, k25, k26, KC_NO, k27},\ + } From 83b9483045d6a84d282e3a4e9d650e81f5368c53 Mon Sep 17 00:00:00 2001 From: yiancar Date: Mon, 21 Feb 2022 17:11:49 +0000 Subject: [PATCH 09/14] [keyboard] DC01 i2c timeout fix (#16392) --- keyboards/dc01/left/config.h | 2 +- keyboards/dc01/left/matrix.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/dc01/left/config.h b/keyboards/dc01/left/config.h index bc934e4a39..43883975c4 100644 --- a/keyboards/dc01/left/config.h +++ b/keyboards/dc01/left/config.h @@ -55,7 +55,7 @@ along with this program. If not, see . // #define BACKLIGHT_LEVELS 3 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 5 +#define DEBOUNCE 0 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST diff --git a/keyboards/dc01/left/matrix.c b/keyboards/dc01/left/matrix.c index bf5aba8497..40533beac4 100644 --- a/keyboards/dc01/left/matrix.c +++ b/keyboards/dc01/left/matrix.c @@ -419,7 +419,7 @@ static void unselect_cols(void) // Complete rows from other modules over i2c i2c_status_t i2c_transaction(uint8_t address, uint32_t mask, uint8_t col_offset) { - i2c_status_t status = i2c_start(address, 50); + i2c_status_t status = i2c_start(address, 5); if (status < 0) { goto error; } From 32903779181c31244c7c7b97a04bda0fd5b59de1 Mon Sep 17 00:00:00 2001 From: peepeetee <43021794+peepeetee@users.noreply.github.com> Date: Tue, 22 Feb 2022 01:12:18 +0800 Subject: [PATCH 10/14] [Keyboard] infinity81 (#16387) --- keyboards/ada/infinity81/config.h | 126 ++++++++++++++++++ keyboards/ada/infinity81/infinity81.c | 4 + keyboards/ada/infinity81/infinity81.h | 30 +++++ keyboards/ada/infinity81/info.json | 92 +++++++++++++ .../ada/infinity81/keymaps/default/keymap.c | 23 ++++ .../ada/infinity81/keymaps/default/readme.md | 1 + keyboards/ada/infinity81/readme.md | 27 ++++ keyboards/ada/infinity81/rules.mk | 18 +++ 8 files changed, 321 insertions(+) create mode 100644 keyboards/ada/infinity81/config.h create mode 100644 keyboards/ada/infinity81/infinity81.c create mode 100644 keyboards/ada/infinity81/infinity81.h create mode 100644 keyboards/ada/infinity81/info.json create mode 100644 keyboards/ada/infinity81/keymaps/default/keymap.c create mode 100644 keyboards/ada/infinity81/keymaps/default/readme.md create mode 100644 keyboards/ada/infinity81/readme.md create mode 100644 keyboards/ada/infinity81/rules.mk diff --git a/keyboards/ada/infinity81/config.h b/keyboards/ada/infinity81/config.h new file mode 100644 index 0000000000..1cbce84720 --- /dev/null +++ b/keyboards/ada/infinity81/config.h @@ -0,0 +1,126 @@ +// Copyright 2022 peepeetee (@peepeetee) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xADA0 +#define PRODUCT_ID 0x0081 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Ada +#define PRODUCT infinity81 + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * + */ +#define MATRIX_ROW_PINS { B3, B2, B1, B0, F6, B7 } +#define MATRIX_COL_PINS { D1, D2, D3, D5, D4, D6, D7, B4, B5, B6, C6, C7, F5, F1, F4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL */ +#define DIODE_DIRECTION COL2ROW + + +//#define LED_NUM_LOCK_PIN B0 +//#define LED_CAPS_LOCK_PIN B1 +//#define LED_SCROLL_LOCK_PIN B2 +//#define LED_COMPOSE_PIN B3 +//#define LED_KANA_PIN B4 + +//#define BACKLIGHT_PIN B7 +//#define BACKLIGHT_LEVELS 3 +//#define BACKLIGHT_BREATHING + +#define RGB_DI_PIN D0 +#ifdef RGB_DI_PIN +# define RGBLED_NUM 107 +# define RGBLIGHT_HUE_STEP 8 +# define RGBLIGHT_SAT_STEP 8 +# define RGBLIGHT_VAL_STEP 8 +# define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +# define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +#define RGBLIGHT_EFFECT_BREATHING +#define RGBLIGHT_EFFECT_RAINBOW_MOOD +#define RGBLIGHT_EFFECT_RAINBOW_SWIRL +#define RGBLIGHT_EFFECT_SNAKE +#define RGBLIGHT_EFFECT_KNIGHT +#define RGBLIGHT_EFFECT_CHRISTMAS +#define RGBLIGHT_EFFECT_STATIC_GRADIENT +#define RGBLIGHT_EFFECT_RGB_TEST +#define RGBLIGHT_EFFECT_ALTERNATING +#define RGBLIGHT_EFFECT_TWINKLE +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is useful for the Windows task manager shortcut (ctrl+shift+esc). + */ +//#define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT + +/* disable these deprecated features by default */ +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + +/* Bootmagic Lite key configuration */ +//#define BOOTMAGIC_LITE_ROW 0 +//#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/ada/infinity81/infinity81.c b/keyboards/ada/infinity81/infinity81.c new file mode 100644 index 0000000000..7e20a1d705 --- /dev/null +++ b/keyboards/ada/infinity81/infinity81.c @@ -0,0 +1,4 @@ +// Copyright 2022 peepeetee (@peepeetee) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "infinity81.h" diff --git a/keyboards/ada/infinity81/infinity81.h b/keyboards/ada/infinity81/infinity81.h new file mode 100644 index 0000000000..199c6f3642 --- /dev/null +++ b/keyboards/ada/infinity81/infinity81.h @@ -0,0 +1,30 @@ +// Copyright 2022 peepeetee (@peepeetee) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "quantum.h" + +/* This is a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K413, K414, \ + K500, K501, K502, K505, K510, K511, K512, K513, K514 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, KC_NO }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, KC_NO, K413, K414 }, \ + { K500, K501, K502, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, KC_NO, K510, K511, K512, K513, K514 } \ +} diff --git a/keyboards/ada/infinity81/info.json b/keyboards/ada/infinity81/info.json new file mode 100644 index 0000000000..71fb774721 --- /dev/null +++ b/keyboards/ada/infinity81/info.json @@ -0,0 +1,92 @@ +{ + "keyboard_name": "infinity81", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT": { + "layout": [ + { "label": "K00 (B3,D1)", "x": 0, "y": 0 }, + { "label": "K01 (B3,D2)", "x": 1.25, "y": 0 }, + { "label": "K02 (B3,D3)", "x": 2.25, "y": 0 }, + { "label": "K03 (B3,D5)", "x": 3.25, "y": 0 }, + { "label": "K04 (B3,D4)", "x": 4.25, "y": 0 }, + { "label": "K05 (B3,D6)", "x": 5.5, "y": 0 }, + { "label": "K06 (B3,D7)", "x": 6.5, "y": 0 }, + { "label": "K07 (B3,B4)", "x": 7.5, "y": 0 }, + { "label": "K08 (B3,B5)", "x": 8.5, "y": 0 }, + { "label": "K09 (B3,B6)", "x": 9.75, "y": 0 }, + { "label": "K0A (B3,C6)", "x": 10.75, "y": 0 }, + { "label": "K0B (B3,C7)", "x": 11.75, "y": 0 }, + { "label": "K0C (B3,F5)", "x": 12.75, "y": 0 }, + { "label": "K10 (B2,D1)", "x": 0, "y": 1.25 }, + { "label": "K11 (B2,D2)", "x": 1, "y": 1.25 }, + { "label": "K12 (B2,D3)", "x": 2, "y": 1.25 }, + { "label": "K13 (B2,D5)", "x": 3, "y": 1.25 }, + { "label": "K14 (B2,D4)", "x": 4, "y": 1.25 }, + { "label": "K15 (B2,D6)", "x": 5, "y": 1.25 }, + { "label": "K16 (B2,D7)", "x": 6, "y": 1.25 }, + { "label": "K17 (B2,B4)", "x": 7, "y": 1.25 }, + { "label": "K18 (B2,B5)", "x": 8, "y": 1.25 }, + { "label": "K19 (B2,B6)", "x": 9, "y": 1.25 }, + { "label": "K1A (B2,C6)", "x": 10, "y": 1.25 }, + { "label": "K1B (B2,C7)", "x": 11, "y": 1.25 }, + { "label": "K1C (B2,F5)", "x": 12, "y": 1.25 }, + { "label": "K1D (B2,F1)", "x": 13, "y": 1.25, "w": 2 }, + { "label": "K1E (B2,F4)", "x": 15, "y": 1.25 }, + { "label": "K20 (B1,D1)", "x": 0, "y": 2.25, "w": 1.5 }, + { "label": "K21 (B1,D2)", "x": 1.5, "y": 2.25 }, + { "label": "K22 (B1,D3)", "x": 2.5, "y": 2.25 }, + { "label": "K23 (B1,D5)", "x": 3.5, "y": 2.25 }, + { "label": "K24 (B1,D4)", "x": 4.5, "y": 2.25 }, + { "label": "K25 (B1,D6)", "x": 5.5, "y": 2.25 }, + { "label": "K26 (B1,D7)", "x": 6.5, "y": 2.25 }, + { "label": "K27 (B1,B4)", "x": 7.5, "y": 2.25 }, + { "label": "K28 (B1,B5)", "x": 8.5, "y": 2.25 }, + { "label": "K29 (B1,B6)", "x": 9.5, "y": 2.25 }, + { "label": "K2A (B1,C6)", "x": 10.5, "y": 2.25 }, + { "label": "K2B (B1,C7)", "x": 11.5, "y": 2.25 }, + { "label": "K2C (B1,F5)", "x": 12.5, "y": 2.25 }, + { "label": "K2D (B1,F1)", "x": 13.5, "y": 2.25, "w": 1.5 }, + { "label": "K2E (B1,F4)", "x": 15, "y": 2.25 }, + { "label": "K30 (B0,D1)", "x": 0, "y": 3.25, "w": 1.75 }, + { "label": "K31 (B0,D2)", "x": 1.75, "y": 3.25 }, + { "label": "K32 (B0,D3)", "x": 2.75, "y": 3.25 }, + { "label": "K33 (B0,D5)", "x": 3.75, "y": 3.25 }, + { "label": "K34 (B0,D4)", "x": 4.75, "y": 3.25 }, + { "label": "K35 (B0,D6)", "x": 5.75, "y": 3.25 }, + { "label": "K36 (B0,D7)", "x": 6.75, "y": 3.25 }, + { "label": "K37 (B0,B4)", "x": 7.75, "y": 3.25 }, + { "label": "K38 (B0,B5)", "x": 8.75, "y": 3.25 }, + { "label": "K39 (B0,B6)", "x": 9.75, "y": 3.25 }, + { "label": "K3A (B0,C6)", "x": 10.75, "y": 3.25 }, + { "label": "K3B (B0,C7)", "x": 11.75, "y": 3.25 }, + { "label": "K3D (B0,F1)", "x": 12.75, "y": 3.25, "w": 2.25 }, + { "label": "K3E (B0,F4)", "x": 15, "y": 3.25 }, + { "label": "K40 (F6,D1)", "x": 0, "y": 4.25, "w": 2.25 }, + { "label": "K41 (F6,D2)", "x": 2.25, "y": 4.25 }, + { "label": "K42 (F6,D3)", "x": 3.25, "y": 4.25 }, + { "label": "K43 (F6,D5)", "x": 4.25, "y": 4.25 }, + { "label": "K44 (F6,D4)", "x": 5.25, "y": 4.25 }, + { "label": "K45 (F6,D6)", "x": 6.25, "y": 4.25 }, + { "label": "K46 (F6,D7)", "x": 7.25, "y": 4.25 }, + { "label": "K47 (F6,B4)", "x": 8.25, "y": 4.25 }, + { "label": "K48 (F6,B5)", "x": 9.25, "y": 4.25 }, + { "label": "K49 (F6,B6)", "x": 10.25, "y": 4.25 }, + { "label": "K4A (F6,C6)", "x": 11.25, "y": 4.25 }, + { "label": "K4B (F6,C7)", "x": 12.25, "y": 4.25, "w": 1.75 }, + { "label": "K4D (F6,F1)", "x": 14, "y": 4.25 }, + { "label": "K4E (F6,F4)", "x": 15, "y": 4.25 }, + { "label": "K50 (B7,D1)", "x": 0, "y": 5.25, "w": 1.25 }, + { "label": "K51 (B7,D2)", "x": 1.25, "y": 5.25, "w": 1.25 }, + { "label": "K52 (B7,D3)", "x": 2.5, "y": 5.25, "w": 1.25 }, + { "label": "K55 (B7,D6)", "x": 3.75, "y": 5.25, "w": 6.25 }, + { "label": "K5A (B7,C6)", "x": 10, "y": 5.25, "w": 1.25 }, + { "label": "K5B (B7,C7)", "x": 11.25, "y": 5.25, "w": 1.25 }, + { "label": "K5C (B7,F5)", "x": 13, "y": 5.25 }, + { "label": "K5D (B7,F1)", "x": 14, "y": 5.25 }, + { "label": "K5E (B7,F4)", "x": 15, "y": 5.25 } + ] + } + } + ,"meta": "https://noroadsleft.github.io/kbf_qmk_converter/" +} diff --git a/keyboards/ada/infinity81/keymaps/default/keymap.c b/keyboards/ada/infinity81/keymaps/default/keymap.c new file mode 100644 index 0000000000..0a6aae93f4 --- /dev/null +++ b/keyboards/ada/infinity81/keymaps/default/keymap.c @@ -0,0 +1,23 @@ +// Copyright 2022 peepeetee (@peepeetee) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT), + [1] = LAYOUT( + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; diff --git a/keyboards/ada/infinity81/keymaps/default/readme.md b/keyboards/ada/infinity81/keymaps/default/readme.md new file mode 100644 index 0000000000..1b6598c1df --- /dev/null +++ b/keyboards/ada/infinity81/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for infinity81 diff --git a/keyboards/ada/infinity81/readme.md b/keyboards/ada/infinity81/readme.md new file mode 100644 index 0000000000..a134379ce5 --- /dev/null +++ b/keyboards/ada/infinity81/readme.md @@ -0,0 +1,27 @@ +# infinity81 + +![infinity81](https://i.imgur.com/9d6IcuA.jpg) + +A per key RGB 75% with blocker keyboard + +* Keyboard Maintainer: [peepeetee](https://github.com/peepeetee) +* Hardware Supported: infinity81 +* Hardware Availability: no longer avaliable - future groupbuy possible + +Make example for this keyboard (after setting up your build environment): + + make ada/infinity81:default + +Flashing example for this keyboard: + + make ada/infinity81:default:flash + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Bootloader + +Enter the bootloader in 3 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +* **Physical reset button**: Briefly press the button on the back of the PCB +* **Keycode in layout**: Press the key mapped to `RESET` if it is available diff --git a/keyboards/ada/infinity81/rules.mk b/keyboards/ada/infinity81/rules.mk new file mode 100644 index 0000000000..3ff392a61f --- /dev/null +++ b/keyboards/ada/infinity81/rules.mk @@ -0,0 +1,18 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output From 2f0dc0fb6d36b43e0d143224e4a9058b77c4e0e3 Mon Sep 17 00:00:00 2001 From: QMK Bot Date: Mon, 21 Feb 2022 09:44:27 -0800 Subject: [PATCH 11/14] Format code according to conventions (#16419) --- drivers/ps2/ps2_busywait.c | 5 +- quantum/action.c | 83 ++- quantum/action.h | 2 +- tmk_core/protocol/arm_atsam/usb/compiler.h | 538 +++++++++--------- tmk_core/protocol/arm_atsam/usb/udi_cdc.c | 16 +- .../protocol/arm_atsam/usb/usb_device_udd.c | 5 +- 6 files changed, 320 insertions(+), 329 deletions(-) diff --git a/drivers/ps2/ps2_busywait.c b/drivers/ps2/ps2_busywait.c index 983194eea8..a426090155 100644 --- a/drivers/ps2/ps2_busywait.c +++ b/drivers/ps2/ps2_busywait.c @@ -125,11 +125,10 @@ uint8_t ps2_host_recv_response(void) { // Command may take 25ms/20ms at most([5]p.46, [3]p.21) // 250 * 100us(wait for start bit in ps2_host_recv) uint8_t data = 0; - uint8_t try - = 250; + uint8_t try = 250; do { data = ps2_host_recv(); - } while (try --&&ps2_error); + } while (try-- && ps2_error); return data; } diff --git a/quantum/action.c b/quantum/action.c index 5e81efb671..7a330b05cd 100644 --- a/quantum/action.c +++ b/quantum/action.c @@ -834,10 +834,9 @@ void register_code(uint8_t code) { } #endif - else if - IS_KEY(code) { - // TODO: should push command_proc out of this block? - if (command_proc(code)) return; + else if IS_KEY (code) { + // TODO: should push command_proc out of this block? + if (command_proc(code)) return; #ifndef NO_ACTION_ONESHOT /* TODO: remove @@ -854,35 +853,33 @@ void register_code(uint8_t code) { } else */ #endif - { - // Force a new key press if the key is already pressed - // without this, keys with the same keycode, but different - // modifiers will be reported incorrectly, see issue #1708 - if (is_key_pressed(keyboard_report, code)) { - del_key(code); - send_keyboard_report(); - } - add_key(code); + { + // Force a new key press if the key is already pressed + // without this, keys with the same keycode, but different + // modifiers will be reported incorrectly, see issue #1708 + if (is_key_pressed(keyboard_report, code)) { + del_key(code); send_keyboard_report(); } - } - else if - IS_MOD(code) { - add_mods(MOD_BIT(code)); + add_key(code); send_keyboard_report(); } + } else if IS_MOD (code) { + add_mods(MOD_BIT(code)); + send_keyboard_report(); + } #ifdef EXTRAKEY_ENABLE - else if - IS_SYSTEM(code) { host_system_send(KEYCODE2SYSTEM(code)); } - else if - IS_CONSUMER(code) { host_consumer_send(KEYCODE2CONSUMER(code)); } + else if IS_SYSTEM (code) { + host_system_send(KEYCODE2SYSTEM(code)); + } else if IS_CONSUMER (code) { + host_consumer_send(KEYCODE2CONSUMER(code)); + } #endif #ifdef MOUSEKEY_ENABLE - else if - IS_MOUSEKEY(code) { - mousekey_on(code); - mousekey_send(); - } + else if IS_MOUSEKEY (code) { + mousekey_on(code); + mousekey_send(); + } #endif } @@ -927,26 +924,22 @@ void unregister_code(uint8_t code) { } #endif - else if - IS_KEY(code) { - del_key(code); - send_keyboard_report(); - } - else if - IS_MOD(code) { - del_mods(MOD_BIT(code)); - send_keyboard_report(); - } - else if - IS_SYSTEM(code) { host_system_send(0); } - else if - IS_CONSUMER(code) { host_consumer_send(0); } + else if IS_KEY (code) { + del_key(code); + send_keyboard_report(); + } else if IS_MOD (code) { + del_mods(MOD_BIT(code)); + send_keyboard_report(); + } else if IS_SYSTEM (code) { + host_system_send(0); + } else if IS_CONSUMER (code) { + host_consumer_send(0); + } #ifdef MOUSEKEY_ENABLE - else if - IS_MOUSEKEY(code) { - mousekey_off(code); - mousekey_send(); - } + else if IS_MOUSEKEY (code) { + mousekey_off(code); + mousekey_send(); + } #endif } diff --git a/quantum/action.h b/quantum/action.h index b562f18c5b..8a357ded87 100644 --- a/quantum/action.h +++ b/quantum/action.h @@ -88,7 +88,7 @@ extern bool disable_action_cache; /* Code for handling one-handed key modifiers. */ #ifdef SWAP_HANDS_ENABLE -extern bool swap_hands; +extern bool swap_hands; extern const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS]; # if (MATRIX_COLS <= 8) typedef uint8_t swap_state_row_t; diff --git a/tmk_core/protocol/arm_atsam/usb/compiler.h b/tmk_core/protocol/arm_atsam/usb/compiler.h index 6ba2322340..4eeef96cf4 100644 --- a/tmk_core/protocol/arm_atsam/usb/compiler.h +++ b/tmk_core/protocol/arm_atsam/usb/compiler.h @@ -43,7 +43,7 @@ */ #ifndef UTILS_COMPILER_H_INCLUDED -# define UTILS_COMPILER_H_INCLUDED +#define UTILS_COMPILER_H_INCLUDED /** * \defgroup group_sam0_utils Compiler abstraction layer and code utilities @@ -54,38 +54,38 @@ * @{ */ -# if (defined __ICCARM__) -# include -# endif +#if (defined __ICCARM__) +# include +#endif -# include +#include //#include //#include //#include //#include -# ifndef __ASSEMBLY__ +#ifndef __ASSEMBLY__ -# include -# include -# include -# include +# include +# include +# include +# include /** * \def UNUSED * \brief Marking \a v as a unused parameter or value. */ -# define UNUSED(v) (void)(v) +# define UNUSED(v) (void)(v) /** * \def barrier * \brief Memory barrier */ -# ifdef __GNUC__ -# define barrier() asm volatile("" ::: "memory") -# else -# define barrier() asm("") -# endif +# ifdef __GNUC__ +# define barrier() asm volatile("" ::: "memory") +# else +# define barrier() asm("") +# endif /** * \brief Emit the compiler pragma \a arg. @@ -93,37 +93,37 @@ * \param[in] arg The pragma directive as it would appear after \e \#pragma * (i.e. not stringified). */ -# define COMPILER_PRAGMA(arg) _Pragma(# arg) +# define COMPILER_PRAGMA(arg) _Pragma(# arg) /** * \def COMPILER_PACK_SET(alignment) * \brief Set maximum alignment for subsequent struct and union definitions to \a alignment. */ -# define COMPILER_PACK_SET(alignment) COMPILER_PRAGMA(pack(alignment)) +# define COMPILER_PACK_SET(alignment) COMPILER_PRAGMA(pack(alignment)) /** * \def COMPILER_PACK_RESET() * \brief Set default alignment for subsequent struct and union definitions. */ -# define COMPILER_PACK_RESET() COMPILER_PRAGMA(pack()) +# define COMPILER_PACK_RESET() COMPILER_PRAGMA(pack()) /** * \brief Set aligned boundary. */ -# if (defined __GNUC__) || (defined __CC_ARM) -# define COMPILER_ALIGNED(a) __attribute__((__aligned__(a))) -# elif (defined __ICCARM__) -# define COMPILER_ALIGNED(a) COMPILER_PRAGMA(data_alignment = a) -# endif +# if (defined __GNUC__) || (defined __CC_ARM) +# define COMPILER_ALIGNED(a) __attribute__((__aligned__(a))) +# elif (defined __ICCARM__) +# define COMPILER_ALIGNED(a) COMPILER_PRAGMA(data_alignment = a) +# endif /** * \brief Set word-aligned boundary. */ -# if (defined __GNUC__) || defined(__CC_ARM) -# define COMPILER_WORD_ALIGNED __attribute__((__aligned__(4))) -# elif (defined __ICCARM__) -# define COMPILER_WORD_ALIGNED COMPILER_PRAGMA(data_alignment = 4) -# endif +# if (defined __GNUC__) || defined(__CC_ARM) +# define COMPILER_WORD_ALIGNED __attribute__((__aligned__(4))) +# elif (defined __ICCARM__) +# define COMPILER_WORD_ALIGNED COMPILER_PRAGMA(data_alignment = 4) +# endif /** * \def __always_inline @@ -133,15 +133,15 @@ * heuristics and inline the function no matter how big it thinks it * becomes. */ -# if !defined(__always_inline) -# if defined(__CC_ARM) -# define __always_inline __forceinline -# elif (defined __GNUC__) -# define __always_inline __attribute__((__always_inline__)) -# elif (defined __ICCARM__) -# define __always_inline _Pragma("inline=forced") -# endif +# if !defined(__always_inline) +# if defined(__CC_ARM) +# define __always_inline __forceinline +# elif (defined __GNUC__) +# define __always_inline __attribute__((__always_inline__)) +# elif (defined __ICCARM__) +# define __always_inline _Pragma("inline=forced") # endif +# endif /** * \def __no_inline @@ -151,13 +151,13 @@ * heuristics and not inline the function no matter how small it thinks it * becomes. */ -# if defined(__CC_ARM) -# define __no_inline __attribute__((noinline)) -# elif (defined __GNUC__) -# define __no_inline __attribute__((noinline)) -# elif (defined __ICCARM__) -# define __no_inline _Pragma("inline=never") -# endif +# if defined(__CC_ARM) +# define __no_inline __attribute__((noinline)) +# elif (defined __GNUC__) +# define __no_inline __attribute__((noinline)) +# elif (defined __ICCARM__) +# define __no_inline _Pragma("inline=never") +# endif /** \brief This macro is used to test fatal errors. * @@ -168,47 +168,47 @@ * * \param[in] expr Expression to evaluate and supposed to be nonzero. */ -# if defined(_ASSERT_ENABLE_) -# if defined(TEST_SUITE_DEFINE_ASSERT_MACRO) -# include "unit_test/suite.h" -# else -# undef TEST_SUITE_DEFINE_ASSERT_MACRO -# define Assert(expr) \ - { \ - if (!(expr)) asm("BKPT #0"); \ - } -# endif +# if defined(_ASSERT_ENABLE_) +# if defined(TEST_SUITE_DEFINE_ASSERT_MACRO) +# include "unit_test/suite.h" # else -# define Assert(expr) ((void)0) +# undef TEST_SUITE_DEFINE_ASSERT_MACRO +# define Assert(expr) \ + { \ + if (!(expr)) asm("BKPT #0"); \ + } # endif +# else +# define Assert(expr) ((void)0) +# endif /* Define WEAK attribute */ -# if defined(__CC_ARM) -# define WEAK __attribute__((weak)) -# elif defined(__ICCARM__) -# define WEAK __weak -# elif defined(__GNUC__) -# define WEAK __attribute__((weak)) -# endif +# if defined(__CC_ARM) +# define WEAK __attribute__((weak)) +# elif defined(__ICCARM__) +# define WEAK __weak +# elif defined(__GNUC__) +# define WEAK __attribute__((weak)) +# endif /* Define NO_INIT attribute */ -# if defined(__CC_ARM) -# define NO_INIT __attribute__((zero_init)) -# elif defined(__ICCARM__) -# define NO_INIT __no_init -# elif defined(__GNUC__) -# define NO_INIT __attribute__((section(".no_init"))) -# endif +# if defined(__CC_ARM) +# define NO_INIT __attribute__((zero_init)) +# elif defined(__ICCARM__) +# define NO_INIT __no_init +# elif defined(__GNUC__) +# define NO_INIT __attribute__((section(".no_init"))) +# endif //#include "interrupt.h" /** \name Usual Types * @{ */ -# ifndef __cplusplus -# if !defined(__bool_true_false_are_defined) +# ifndef __cplusplus +# if !defined(__bool_true_false_are_defined) typedef unsigned char bool; -# endif # endif +# endif typedef uint16_t le16_t; typedef uint16_t be16_t; typedef uint32_t le32_t; @@ -347,22 +347,22 @@ typedef struct { /** @} */ -# endif /* #ifndef __ASSEMBLY__ */ +#endif /* #ifndef __ASSEMBLY__ */ /** \name Usual Constants * @{ */ // kmod #define DISABLE 0 // kmod #define ENABLE 1 -# ifndef __cplusplus -# if !defined(__bool_true_false_are_defined) -# define false 0 -# define true 1 -# endif +#ifndef __cplusplus +# if !defined(__bool_true_false_are_defined) +# define false 0 +# define true 1 # endif +#endif /** @} */ -# ifndef __ASSEMBLY__ +#ifndef __ASSEMBLY__ /** \name Optimization Control * @{ */ @@ -371,17 +371,17 @@ typedef struct { * \def likely(exp) * \brief The expression \a exp is likely to be true */ -# if !defined(likely) || defined(__DOXYGEN__) -# define likely(exp) (exp) -# endif +# if !defined(likely) || defined(__DOXYGEN__) +# define likely(exp) (exp) +# endif /** * \def unlikely(exp) * \brief The expression \a exp is unlikely to be true */ -# if !defined(unlikely) || defined(__DOXYGEN__) -# define unlikely(exp) (exp) -# endif +# if !defined(unlikely) || defined(__DOXYGEN__) +# define unlikely(exp) (exp) +# endif /** * \def is_constant(exp) @@ -391,11 +391,11 @@ typedef struct { * * \return true if \a exp is constant, false otherwise. */ -# if (defined __GNUC__) || (defined __CC_ARM) -# define is_constant(exp) __builtin_constant_p(exp) -# else -# define is_constant(exp) (0) -# endif +# if (defined __GNUC__) || (defined __CC_ARM) +# define is_constant(exp) __builtin_constant_p(exp) +# else +# define is_constant(exp) (0) +# endif /** @} */ @@ -409,7 +409,7 @@ typedef struct { * * \return Read bits. */ -# define Rd_bits(value, mask) ((value) & (mask)) +# define Rd_bits(value, mask) ((value) & (mask)) /** \brief Writes the bits of a C lvalue specified by a given bit-mask. * @@ -419,7 +419,7 @@ typedef struct { * * \return Resulting value with written bits. */ -# define Wr_bits(lvalue, mask, bits) ((lvalue) = ((lvalue) & ~(mask)) | ((bits) & (mask))) +# define Wr_bits(lvalue, mask, bits) ((lvalue) = ((lvalue) & ~(mask)) | ((bits) & (mask))) /** \brief Tests the bits of a value specified by a given bit-mask. * @@ -428,7 +428,7 @@ typedef struct { * * \return \c 1 if at least one of the tested bits is set, else \c 0. */ -# define Tst_bits(value, mask) (Rd_bits(value, mask) != 0) +# define Tst_bits(value, mask) (Rd_bits(value, mask) != 0) /** \brief Clears the bits of a C lvalue specified by a given bit-mask. * @@ -437,7 +437,7 @@ typedef struct { * * \return Resulting value with cleared bits. */ -# define Clr_bits(lvalue, mask) ((lvalue) &= ~(mask)) +# define Clr_bits(lvalue, mask) ((lvalue) &= ~(mask)) /** \brief Sets the bits of a C lvalue specified by a given bit-mask. * @@ -446,7 +446,7 @@ typedef struct { * * \return Resulting value with set bits. */ -# define Set_bits(lvalue, mask) ((lvalue) |= (mask)) +# define Set_bits(lvalue, mask) ((lvalue) |= (mask)) /** \brief Toggles the bits of a C lvalue specified by a given bit-mask. * @@ -455,7 +455,7 @@ typedef struct { * * \return Resulting value with toggled bits. */ -# define Tgl_bits(lvalue, mask) ((lvalue) ^= (mask)) +# define Tgl_bits(lvalue, mask) ((lvalue) ^= (mask)) /** \brief Reads the bit-field of a value specified by a given bit-mask. * @@ -464,7 +464,7 @@ typedef struct { * * \return Read bit-field. */ -# define Rd_bitfield(value, mask) (Rd_bits(value, mask) >> ctz(mask)) +# define Rd_bitfield(value, mask) (Rd_bits(value, mask) >> ctz(mask)) /** \brief Writes the bit-field of a C lvalue specified by a given bit-mask. * @@ -474,7 +474,7 @@ typedef struct { * * \return Resulting value with written bit-field. */ -# define Wr_bitfield(lvalue, mask, bitfield) (Wr_bits(lvalue, mask, (uint32_t)(bitfield) << ctz(mask))) +# define Wr_bitfield(lvalue, mask, bitfield) (Wr_bits(lvalue, mask, (uint32_t)(bitfield) << ctz(mask))) /** @} */ @@ -498,11 +498,11 @@ typedef struct { * * \return The count of leading zero bits in \a u. */ -# if (defined __GNUC__) || (defined __CC_ARM) -# define clz(u) ((u) ? __builtin_clz(u) : 32) -# else -# define clz(u) (((u) == 0) ? 32 : ((u) & (1ul << 31)) ? 0 : ((u) & (1ul << 30)) ? 1 : ((u) & (1ul << 29)) ? 2 : ((u) & (1ul << 28)) ? 3 : ((u) & (1ul << 27)) ? 4 : ((u) & (1ul << 26)) ? 5 : ((u) & (1ul << 25)) ? 6 : ((u) & (1ul << 24)) ? 7 : ((u) & (1ul << 23)) ? 8 : ((u) & (1ul << 22)) ? 9 : ((u) & (1ul << 21)) ? 10 : ((u) & (1ul << 20)) ? 11 : ((u) & (1ul << 19)) ? 12 : ((u) & (1ul << 18)) ? 13 : ((u) & (1ul << 17)) ? 14 : ((u) & (1ul << 16)) ? 15 : ((u) & (1ul << 15)) ? 16 : ((u) & (1ul << 14)) ? 17 : ((u) & (1ul << 13)) ? 18 : ((u) & (1ul << 12)) ? 19 : ((u) & (1ul << 11)) ? 20 : ((u) & (1ul << 10)) ? 21 : ((u) & (1ul << 9)) ? 22 : ((u) & (1ul << 8)) ? 23 : ((u) & (1ul << 7)) ? 24 : ((u) & (1ul << 6)) ? 25 : ((u) & (1ul << 5)) ? 26 : ((u) & (1ul << 4)) ? 27 : ((u) & (1ul << 3)) ? 28 : ((u) & (1ul << 2)) ? 29 : ((u) & (1ul << 1)) ? 30 : 31) -# endif +# if (defined __GNUC__) || (defined __CC_ARM) +# define clz(u) ((u) ? __builtin_clz(u) : 32) +# else +# define clz(u) (((u) == 0) ? 32 : ((u) & (1ul << 31)) ? 0 : ((u) & (1ul << 30)) ? 1 : ((u) & (1ul << 29)) ? 2 : ((u) & (1ul << 28)) ? 3 : ((u) & (1ul << 27)) ? 4 : ((u) & (1ul << 26)) ? 5 : ((u) & (1ul << 25)) ? 6 : ((u) & (1ul << 24)) ? 7 : ((u) & (1ul << 23)) ? 8 : ((u) & (1ul << 22)) ? 9 : ((u) & (1ul << 21)) ? 10 : ((u) & (1ul << 20)) ? 11 : ((u) & (1ul << 19)) ? 12 : ((u) & (1ul << 18)) ? 13 : ((u) & (1ul << 17)) ? 14 : ((u) & (1ul << 16)) ? 15 : ((u) & (1ul << 15)) ? 16 : ((u) & (1ul << 14)) ? 17 : ((u) & (1ul << 13)) ? 18 : ((u) & (1ul << 12)) ? 19 : ((u) & (1ul << 11)) ? 20 : ((u) & (1ul << 10)) ? 21 : ((u) & (1ul << 9)) ? 22 : ((u) & (1ul << 8)) ? 23 : ((u) & (1ul << 7)) ? 24 : ((u) & (1ul << 6)) ? 25 : ((u) & (1ul << 5)) ? 26 : ((u) & (1ul << 4)) ? 27 : ((u) & (1ul << 3)) ? 28 : ((u) & (1ul << 2)) ? 29 : ((u) & (1ul << 1)) ? 30 : 31) +# endif /** \brief Counts the trailing zero bits of the given value considered as a 32-bit integer. * @@ -510,11 +510,11 @@ typedef struct { * * \return The count of trailing zero bits in \a u. */ -# if (defined __GNUC__) || (defined __CC_ARM) -# define ctz(u) ((u) ? __builtin_ctz(u) : 32) -# else -# define ctz(u) ((u) & (1ul << 0) ? 0 : (u) & (1ul << 1) ? 1 : (u) & (1ul << 2) ? 2 : (u) & (1ul << 3) ? 3 : (u) & (1ul << 4) ? 4 : (u) & (1ul << 5) ? 5 : (u) & (1ul << 6) ? 6 : (u) & (1ul << 7) ? 7 : (u) & (1ul << 8) ? 8 : (u) & (1ul << 9) ? 9 : (u) & (1ul << 10) ? 10 : (u) & (1ul << 11) ? 11 : (u) & (1ul << 12) ? 12 : (u) & (1ul << 13) ? 13 : (u) & (1ul << 14) ? 14 : (u) & (1ul << 15) ? 15 : (u) & (1ul << 16) ? 16 : (u) & (1ul << 17) ? 17 : (u) & (1ul << 18) ? 18 : (u) & (1ul << 19) ? 19 : (u) & (1ul << 20) ? 20 : (u) & (1ul << 21) ? 21 : (u) & (1ul << 22) ? 22 : (u) & (1ul << 23) ? 23 : (u) & (1ul << 24) ? 24 : (u) & (1ul << 25) ? 25 : (u) & (1ul << 26) ? 26 : (u) & (1ul << 27) ? 27 : (u) & (1ul << 28) ? 28 : (u) & (1ul << 29) ? 29 : (u) & (1ul << 30) ? 30 : (u) & (1ul << 31) ? 31 : 32) -# endif +# if (defined __GNUC__) || (defined __CC_ARM) +# define ctz(u) ((u) ? __builtin_ctz(u) : 32) +# else +# define ctz(u) ((u) & (1ul << 0) ? 0 : (u) & (1ul << 1) ? 1 : (u) & (1ul << 2) ? 2 : (u) & (1ul << 3) ? 3 : (u) & (1ul << 4) ? 4 : (u) & (1ul << 5) ? 5 : (u) & (1ul << 6) ? 6 : (u) & (1ul << 7) ? 7 : (u) & (1ul << 8) ? 8 : (u) & (1ul << 9) ? 9 : (u) & (1ul << 10) ? 10 : (u) & (1ul << 11) ? 11 : (u) & (1ul << 12) ? 12 : (u) & (1ul << 13) ? 13 : (u) & (1ul << 14) ? 14 : (u) & (1ul << 15) ? 15 : (u) & (1ul << 16) ? 16 : (u) & (1ul << 17) ? 17 : (u) & (1ul << 18) ? 18 : (u) & (1ul << 19) ? 19 : (u) & (1ul << 20) ? 20 : (u) & (1ul << 21) ? 21 : (u) & (1ul << 22) ? 22 : (u) & (1ul << 23) ? 23 : (u) & (1ul << 24) ? 24 : (u) & (1ul << 25) ? 25 : (u) & (1ul << 26) ? 26 : (u) & (1ul << 27) ? 27 : (u) & (1ul << 28) ? 28 : (u) & (1ul << 29) ? 29 : (u) & (1ul << 30) ? 30 : (u) & (1ul << 31) ? 31 : 32) +# endif /** @} */ @@ -527,7 +527,7 @@ typedef struct { * * \return Value resulting from \a u8 with reversed bits. */ -# define bit_reverse8(u8) ((U8)(bit_reverse32((U8)(u8)) >> 24)) +# define bit_reverse8(u8) ((U8)(bit_reverse32((U8)(u8)) >> 24)) /** \brief Reverses the bits of \a u16. * @@ -535,7 +535,7 @@ typedef struct { * * \return Value resulting from \a u16 with reversed bits. */ -# define bit_reverse16(u16) ((uint16_t)(bit_reverse32((uint16_t)(u16)) >> 16)) +# define bit_reverse16(u16) ((uint16_t)(bit_reverse32((uint16_t)(u16)) >> 16)) /** \brief Reverses the bits of \a u32. * @@ -543,7 +543,7 @@ typedef struct { * * \return Value resulting from \a u32 with reversed bits. */ -# define bit_reverse32(u32) __RBIT(u32) +# define bit_reverse32(u32) __RBIT(u32) /** \brief Reverses the bits of \a u64. * @@ -551,7 +551,7 @@ typedef struct { * * \return Value resulting from \a u64 with reversed bits. */ -# define bit_reverse64(u64) ((uint64_t)(((uint64_t)bit_reverse32((uint64_t)(u64) >> 32)) | ((uint64_t)bit_reverse32((uint64_t)(u64)) << 32))) +# define bit_reverse64(u64) ((uint64_t)(((uint64_t)bit_reverse32((uint64_t)(u64) >> 32)) | ((uint64_t)bit_reverse32((uint64_t)(u64)) << 32))) /** @} */ @@ -565,7 +565,7 @@ typedef struct { * * \return \c 1 if the number \a val is aligned with the \a n boundary, else \c 0. */ -# define Test_align(val, n) (!Tst_bits(val, (n)-1)) +# define Test_align(val, n) (!Tst_bits(val, (n)-1)) /** \brief Gets alignment of the number \a val with respect to the \a n boundary. * @@ -574,7 +574,7 @@ typedef struct { * * \return Alignment of the number \a val with respect to the \a n boundary. */ -# define Get_align(val, n) (Rd_bits(val, (n)-1)) +# define Get_align(val, n) (Rd_bits(val, (n)-1)) /** \brief Sets alignment of the lvalue number \a lval to \a alg with respect to the \a n boundary. * @@ -584,7 +584,7 @@ typedef struct { * * \return New value of \a lval resulting from its alignment set to \a alg with respect to the \a n boundary. */ -# define Set_align(lval, n, alg) (Wr_bits(lval, (n)-1, alg)) +# define Set_align(lval, n, alg) (Wr_bits(lval, (n)-1, alg)) /** \brief Aligns the number \a val with the upper \a n boundary. * @@ -593,7 +593,7 @@ typedef struct { * * \return Value resulting from the number \a val aligned with the upper \a n boundary. */ -# define Align_up(val, n) (((val) + ((n)-1)) & ~((n)-1)) +# define Align_up(val, n) (((val) + ((n)-1)) & ~((n)-1)) /** \brief Aligns the number \a val with the lower \a n boundary. * @@ -602,7 +602,7 @@ typedef struct { * * \return Value resulting from the number \a val aligned with the lower \a n boundary. */ -# define Align_down(val, n) ((val) & ~((n)-1)) +# define Align_down(val, n) ((val) & ~((n)-1)) /** @} */ @@ -627,9 +627,9 @@ typedef struct { * * \note More optimized if only used with values known at compile time. */ -# define Abs(a) (((a) < 0) ? -(a) : (a)) +# define Abs(a) (((a) < 0) ? -(a) : (a)) -# ifndef __cplusplus +# ifndef __cplusplus /** \brief Takes the minimal value of \a a and \a b. * * \param[in] a Input value. @@ -639,7 +639,7 @@ typedef struct { * * \note More optimized if only used with values known at compile time. */ -# define Min(a, b) (((a) < (b)) ? (a) : (b)) +# define Min(a, b) (((a) < (b)) ? (a) : (b)) /** \brief Takes the maximal value of \a a and \a b. * @@ -650,7 +650,7 @@ typedef struct { * * \note More optimized if only used with values known at compile time. */ -# define Max(a, b) (((a) > (b)) ? (a) : (b)) +# define Max(a, b) (((a) > (b)) ? (a) : (b)) /** \brief Takes the minimal value of \a a and \a b. * @@ -661,7 +661,7 @@ typedef struct { * * \note More optimized if only used with values unknown at compile time. */ -# define min(a, b) Min(a, b) +# define min(a, b) Min(a, b) /** \brief Takes the maximal value of \a a and \a b. * @@ -672,8 +672,8 @@ typedef struct { * * \note More optimized if only used with values unknown at compile time. */ -# define max(a, b) Max(a, b) -# endif +# define max(a, b) Max(a, b) +# endif /** @} */ @@ -688,34 +688,34 @@ typedef struct { * * \note It may be used as a long jump opcode in some special cases. */ -# define Long_call(addr) ((*(void (*)(void))(addr))()) +# define Long_call(addr) ((*(void (*)(void))(addr))()) /** \name MCU Endianism Handling * ARM is MCU little endian. * * @{ */ -# define BE16(x) swap16(x) -# define LE16(x) (x) +# define BE16(x) swap16(x) +# define LE16(x) (x) -# define le16_to_cpu(x) (x) -# define cpu_to_le16(x) (x) -# define LE16_TO_CPU(x) (x) -# define CPU_TO_LE16(x) (x) +# define le16_to_cpu(x) (x) +# define cpu_to_le16(x) (x) +# define LE16_TO_CPU(x) (x) +# define CPU_TO_LE16(x) (x) -# define be16_to_cpu(x) swap16(x) -# define cpu_to_be16(x) swap16(x) -# define BE16_TO_CPU(x) swap16(x) -# define CPU_TO_BE16(x) swap16(x) +# define be16_to_cpu(x) swap16(x) +# define cpu_to_be16(x) swap16(x) +# define BE16_TO_CPU(x) swap16(x) +# define CPU_TO_BE16(x) swap16(x) -# define le32_to_cpu(x) (x) -# define cpu_to_le32(x) (x) -# define LE32_TO_CPU(x) (x) -# define CPU_TO_LE32(x) (x) +# define le32_to_cpu(x) (x) +# define cpu_to_le32(x) (x) +# define LE32_TO_CPU(x) (x) +# define CPU_TO_LE32(x) (x) -# define be32_to_cpu(x) swap32(x) -# define cpu_to_be32(x) swap32(x) -# define BE32_TO_CPU(x) swap32(x) -# define CPU_TO_BE32(x) swap32(x) +# define be32_to_cpu(x) swap32(x) +# define cpu_to_be32(x) swap32(x) +# define BE32_TO_CPU(x) swap32(x) +# define CPU_TO_BE32(x) swap32(x) /** @} */ /** \name Endianism Conversion @@ -738,7 +738,7 @@ typedef struct { * * \note More optimized if only used with values known at compile time. */ -# define Swap16(u16) ((uint16_t)(((uint16_t)(u16) >> 8) | ((uint16_t)(u16) << 8))) +# define Swap16(u16) ((uint16_t)(((uint16_t)(u16) >> 8) | ((uint16_t)(u16) << 8))) /** \brief Toggles the endianism of \a u32 (by swapping its bytes). * @@ -748,7 +748,7 @@ typedef struct { * * \note More optimized if only used with values known at compile time. */ -# define Swap32(u32) ((uint32_t)(((uint32_t)Swap16((uint32_t)(u32) >> 16)) | ((uint32_t)Swap16((uint32_t)(u32)) << 16))) +# define Swap32(u32) ((uint32_t)(((uint32_t)Swap16((uint32_t)(u32) >> 16)) | ((uint32_t)Swap16((uint32_t)(u32)) << 16))) /** \brief Toggles the endianism of \a u64 (by swapping its bytes). * @@ -758,7 +758,7 @@ typedef struct { * * \note More optimized if only used with values known at compile time. */ -# define Swap64(u64) ((uint64_t)(((uint64_t)Swap32((uint64_t)(u64) >> 32)) | ((uint64_t)Swap32((uint64_t)(u64)) << 32))) +# define Swap64(u64) ((uint64_t)(((uint64_t)Swap32((uint64_t)(u64) >> 32)) | ((uint64_t)Swap32((uint64_t)(u64)) << 32))) /** \brief Toggles the endianism of \a u16 (by swapping its bytes). * @@ -768,7 +768,7 @@ typedef struct { * * \note More optimized if only used with values unknown at compile time. */ -# define swap16(u16) Swap16(u16) +# define swap16(u16) Swap16(u16) /** \brief Toggles the endianism of \a u32 (by swapping its bytes). * @@ -778,11 +778,11 @@ typedef struct { * * \note More optimized if only used with values unknown at compile time. */ -# if (defined __GNUC__) -# define swap32(u32) ((uint32_t)__builtin_bswap32((uint32_t)(u32))) -# else -# define swap32(u32) Swap32(u32) -# endif +# if (defined __GNUC__) +# define swap32(u32) ((uint32_t)__builtin_bswap32((uint32_t)(u32))) +# else +# define swap32(u32) Swap32(u32) +# endif /** \brief Toggles the endianism of \a u64 (by swapping its bytes). * @@ -792,11 +792,11 @@ typedef struct { * * \note More optimized if only used with values unknown at compile time. */ -# if (defined __GNUC__) -# define swap64(u64) ((uint64_t)__builtin_bswap64((uint64_t)(u64))) -# else -# define swap64(u64) ((uint64_t)(((uint64_t)swap32((uint64_t)(u64) >> 32)) | ((uint64_t)swap32((uint64_t)(u64)) << 32))) -# endif +# if (defined __GNUC__) +# define swap64(u64) ((uint64_t)__builtin_bswap64((uint64_t)(u64))) +# else +# define swap64(u64) ((uint64_t)(((uint64_t)swap32((uint64_t)(u64) >> 32)) | ((uint64_t)swap32((uint64_t)(u64)) << 32))) +# endif /** @} */ @@ -804,16 +804,16 @@ typedef struct { * * @{ */ -# define _GLOBEXT_ extern /**< extern storage-class specifier. */ -# define _CONST_TYPE_ const /**< const type qualifier. */ -# define _MEM_TYPE_SLOW_ /**< Slow memory type. */ -# define _MEM_TYPE_MEDFAST_ /**< Fairly fast memory type. */ -# define _MEM_TYPE_FAST_ /**< Fast memory type. */ +# define _GLOBEXT_ extern /**< extern storage-class specifier. */ +# define _CONST_TYPE_ const /**< const type qualifier. */ +# define _MEM_TYPE_SLOW_ /**< Slow memory type. */ +# define _MEM_TYPE_MEDFAST_ /**< Fairly fast memory type. */ +# define _MEM_TYPE_FAST_ /**< Fast memory type. */ -# define memcmp_ram2ram memcmp /**< Target-specific memcmp of RAM to RAM. */ -# define memcmp_code2ram memcmp /**< Target-specific memcmp of RAM to NVRAM. */ -# define memcpy_ram2ram memcpy /**< Target-specific memcpy from RAM to RAM. */ -# define memcpy_code2ram memcpy /**< Target-specific memcpy from NVRAM to RAM. */ +# define memcmp_ram2ram memcmp /**< Target-specific memcmp of RAM to RAM. */ +# define memcmp_code2ram memcmp /**< Target-specific memcmp of RAM to NVRAM. */ +# define memcpy_ram2ram memcpy /**< Target-specific memcpy from RAM to RAM. */ +# define memcpy_code2ram memcpy /**< Target-specific memcpy from NVRAM to RAM. */ /** @} */ @@ -826,51 +826,51 @@ typedef struct { * * \return (\a a / \a b) rounded up to the nearest integer. */ -# define div_ceil(a, b) (((a) + (b)-1) / (b)) +# define div_ceil(a, b) (((a) + (b)-1) / (b)) -# endif /* #ifndef __ASSEMBLY__ */ -# ifdef __ICCARM__ +#endif /* #ifndef __ASSEMBLY__ */ +#ifdef __ICCARM__ /** \name Compiler Keywords * * Port of some keywords from GCC to IAR Embedded Workbench. * * @{ */ -# define __asm__ asm -# define __inline__ inline -# define __volatile__ +# define __asm__ asm +# define __inline__ inline +# define __volatile__ /** @} */ -# endif +#endif -# define FUNC_PTR void * +#define FUNC_PTR void * /** * \def unused * \brief Marking \a v as a unused parameter or value. */ -# define unused(v) \ - do { \ - (void)(v); \ - } while (0) +#define unused(v) \ + do { \ + (void)(v); \ + } while (0) /* Define RAMFUNC attribute */ -# if defined(__CC_ARM) /* Keil uVision 4 */ -# define RAMFUNC __attribute__((section(".ramfunc"))) -# elif defined(__ICCARM__) /* IAR Ewarm 5.41+ */ -# define RAMFUNC __ramfunc -# elif defined(__GNUC__) /* GCC CS3 2009q3-68 */ -# define RAMFUNC __attribute__((section(".ramfunc"))) -# endif +#if defined(__CC_ARM) /* Keil uVision 4 */ +# define RAMFUNC __attribute__((section(".ramfunc"))) +#elif defined(__ICCARM__) /* IAR Ewarm 5.41+ */ +# define RAMFUNC __ramfunc +#elif defined(__GNUC__) /* GCC CS3 2009q3-68 */ +# define RAMFUNC __attribute__((section(".ramfunc"))) +#endif /* Define OPTIMIZE_HIGH attribute */ -# if defined(__CC_ARM) /* Keil uVision 4 */ -# define OPTIMIZE_HIGH _Pragma("O3") -# elif defined(__ICCARM__) /* IAR Ewarm 5.41+ */ -# define OPTIMIZE_HIGH _Pragma("optimize=high") -# elif defined(__GNUC__) /* GCC CS3 2009q3-68 */ -# define OPTIMIZE_HIGH __attribute__((optimize("s"))) -# endif +#if defined(__CC_ARM) /* Keil uVision 4 */ +# define OPTIMIZE_HIGH _Pragma("O3") +#elif defined(__ICCARM__) /* IAR Ewarm 5.41+ */ +# define OPTIMIZE_HIGH _Pragma("optimize=high") +#elif defined(__GNUC__) /* GCC CS3 2009q3-68 */ +# define OPTIMIZE_HIGH __attribute__((optimize("s"))) +#endif // kmod #define PASS 0 // kmod #define FAIL 1 // kmod #define LOW 0 @@ -887,101 +887,101 @@ typedef uint64_t U64; //!< 64-bit unsigned integer. typedef float F32; //!< 32-bit floating-point number. typedef double F64; //!< 64-bit floating-point number. -# define MSB(u16) (((U8 *)&(u16))[1]) //!< Most significant byte of \a u16. -# define LSB(u16) (((U8 *)&(u16))[0]) //!< Least significant byte of \a u16. +#define MSB(u16) (((U8 *)&(u16))[1]) //!< Most significant byte of \a u16. +#define LSB(u16) (((U8 *)&(u16))[0]) //!< Least significant byte of \a u16. -# define MSH(u32) (((U16 *)&(u32))[1]) //!< Most significant half-word of \a u32. -# define LSH(u32) (((U16 *)&(u32))[0]) //!< Least significant half-word of \a u32. -# define MSB0W(u32) (((U8 *)&(u32))[3]) //!< Most significant byte of 1st rank of \a u32. -# define MSB1W(u32) (((U8 *)&(u32))[2]) //!< Most significant byte of 2nd rank of \a u32. -# define MSB2W(u32) (((U8 *)&(u32))[1]) //!< Most significant byte of 3rd rank of \a u32. -# define MSB3W(u32) (((U8 *)&(u32))[0]) //!< Most significant byte of 4th rank of \a u32. -# define LSB3W(u32) MSB0W(u32) //!< Least significant byte of 4th rank of \a u32. -# define LSB2W(u32) MSB1W(u32) //!< Least significant byte of 3rd rank of \a u32. -# define LSB1W(u32) MSB2W(u32) //!< Least significant byte of 2nd rank of \a u32. -# define LSB0W(u32) MSB3W(u32) //!< Least significant byte of 1st rank of \a u32. +#define MSH(u32) (((U16 *)&(u32))[1]) //!< Most significant half-word of \a u32. +#define LSH(u32) (((U16 *)&(u32))[0]) //!< Least significant half-word of \a u32. +#define MSB0W(u32) (((U8 *)&(u32))[3]) //!< Most significant byte of 1st rank of \a u32. +#define MSB1W(u32) (((U8 *)&(u32))[2]) //!< Most significant byte of 2nd rank of \a u32. +#define MSB2W(u32) (((U8 *)&(u32))[1]) //!< Most significant byte of 3rd rank of \a u32. +#define MSB3W(u32) (((U8 *)&(u32))[0]) //!< Most significant byte of 4th rank of \a u32. +#define LSB3W(u32) MSB0W(u32) //!< Least significant byte of 4th rank of \a u32. +#define LSB2W(u32) MSB1W(u32) //!< Least significant byte of 3rd rank of \a u32. +#define LSB1W(u32) MSB2W(u32) //!< Least significant byte of 2nd rank of \a u32. +#define LSB0W(u32) MSB3W(u32) //!< Least significant byte of 1st rank of \a u32. -# define MSW(u64) (((U32 *)&(u64))[1]) //!< Most significant word of \a u64. -# define LSW(u64) (((U32 *)&(u64))[0]) //!< Least significant word of \a u64. -# define MSH0(u64) (((U16 *)&(u64))[3]) //!< Most significant half-word of 1st rank of \a u64. -# define MSH1(u64) (((U16 *)&(u64))[2]) //!< Most significant half-word of 2nd rank of \a u64. -# define MSH2(u64) (((U16 *)&(u64))[1]) //!< Most significant half-word of 3rd rank of \a u64. -# define MSH3(u64) (((U16 *)&(u64))[0]) //!< Most significant half-word of 4th rank of \a u64. -# define LSH3(u64) MSH0(u64) //!< Least significant half-word of 4th rank of \a u64. -# define LSH2(u64) MSH1(u64) //!< Least significant half-word of 3rd rank of \a u64. -# define LSH1(u64) MSH2(u64) //!< Least significant half-word of 2nd rank of \a u64. -# define LSH0(u64) MSH3(u64) //!< Least significant half-word of 1st rank of \a u64. -# define MSB0D(u64) (((U8 *)&(u64))[7]) //!< Most significant byte of 1st rank of \a u64. -# define MSB1D(u64) (((U8 *)&(u64))[6]) //!< Most significant byte of 2nd rank of \a u64. -# define MSB2D(u64) (((U8 *)&(u64))[5]) //!< Most significant byte of 3rd rank of \a u64. -# define MSB3D(u64) (((U8 *)&(u64))[4]) //!< Most significant byte of 4th rank of \a u64. -# define MSB4D(u64) (((U8 *)&(u64))[3]) //!< Most significant byte of 5th rank of \a u64. -# define MSB5D(u64) (((U8 *)&(u64))[2]) //!< Most significant byte of 6th rank of \a u64. -# define MSB6D(u64) (((U8 *)&(u64))[1]) //!< Most significant byte of 7th rank of \a u64. -# define MSB7D(u64) (((U8 *)&(u64))[0]) //!< Most significant byte of 8th rank of \a u64. -# define LSB7D(u64) MSB0D(u64) //!< Least significant byte of 8th rank of \a u64. -# define LSB6D(u64) MSB1D(u64) //!< Least significant byte of 7th rank of \a u64. -# define LSB5D(u64) MSB2D(u64) //!< Least significant byte of 6th rank of \a u64. -# define LSB4D(u64) MSB3D(u64) //!< Least significant byte of 5th rank of \a u64. -# define LSB3D(u64) MSB4D(u64) //!< Least significant byte of 4th rank of \a u64. -# define LSB2D(u64) MSB5D(u64) //!< Least significant byte of 3rd rank of \a u64. -# define LSB1D(u64) MSB6D(u64) //!< Least significant byte of 2nd rank of \a u64. -# define LSB0D(u64) MSB7D(u64) //!< Least significant byte of 1st rank of \a u64. +#define MSW(u64) (((U32 *)&(u64))[1]) //!< Most significant word of \a u64. +#define LSW(u64) (((U32 *)&(u64))[0]) //!< Least significant word of \a u64. +#define MSH0(u64) (((U16 *)&(u64))[3]) //!< Most significant half-word of 1st rank of \a u64. +#define MSH1(u64) (((U16 *)&(u64))[2]) //!< Most significant half-word of 2nd rank of \a u64. +#define MSH2(u64) (((U16 *)&(u64))[1]) //!< Most significant half-word of 3rd rank of \a u64. +#define MSH3(u64) (((U16 *)&(u64))[0]) //!< Most significant half-word of 4th rank of \a u64. +#define LSH3(u64) MSH0(u64) //!< Least significant half-word of 4th rank of \a u64. +#define LSH2(u64) MSH1(u64) //!< Least significant half-word of 3rd rank of \a u64. +#define LSH1(u64) MSH2(u64) //!< Least significant half-word of 2nd rank of \a u64. +#define LSH0(u64) MSH3(u64) //!< Least significant half-word of 1st rank of \a u64. +#define MSB0D(u64) (((U8 *)&(u64))[7]) //!< Most significant byte of 1st rank of \a u64. +#define MSB1D(u64) (((U8 *)&(u64))[6]) //!< Most significant byte of 2nd rank of \a u64. +#define MSB2D(u64) (((U8 *)&(u64))[5]) //!< Most significant byte of 3rd rank of \a u64. +#define MSB3D(u64) (((U8 *)&(u64))[4]) //!< Most significant byte of 4th rank of \a u64. +#define MSB4D(u64) (((U8 *)&(u64))[3]) //!< Most significant byte of 5th rank of \a u64. +#define MSB5D(u64) (((U8 *)&(u64))[2]) //!< Most significant byte of 6th rank of \a u64. +#define MSB6D(u64) (((U8 *)&(u64))[1]) //!< Most significant byte of 7th rank of \a u64. +#define MSB7D(u64) (((U8 *)&(u64))[0]) //!< Most significant byte of 8th rank of \a u64. +#define LSB7D(u64) MSB0D(u64) //!< Least significant byte of 8th rank of \a u64. +#define LSB6D(u64) MSB1D(u64) //!< Least significant byte of 7th rank of \a u64. +#define LSB5D(u64) MSB2D(u64) //!< Least significant byte of 6th rank of \a u64. +#define LSB4D(u64) MSB3D(u64) //!< Least significant byte of 5th rank of \a u64. +#define LSB3D(u64) MSB4D(u64) //!< Least significant byte of 4th rank of \a u64. +#define LSB2D(u64) MSB5D(u64) //!< Least significant byte of 3rd rank of \a u64. +#define LSB1D(u64) MSB6D(u64) //!< Least significant byte of 2nd rank of \a u64. +#define LSB0D(u64) MSB7D(u64) //!< Least significant byte of 1st rank of \a u64. -# define LSB0(u32) LSB0W(u32) //!< Least significant byte of 1st rank of \a u32. -# define LSB1(u32) LSB1W(u32) //!< Least significant byte of 2nd rank of \a u32. -# define LSB2(u32) LSB2W(u32) //!< Least significant byte of 3rd rank of \a u32. -# define LSB3(u32) LSB3W(u32) //!< Least significant byte of 4th rank of \a u32. -# define MSB3(u32) MSB3W(u32) //!< Most significant byte of 4th rank of \a u32. -# define MSB2(u32) MSB2W(u32) //!< Most significant byte of 3rd rank of \a u32. -# define MSB1(u32) MSB1W(u32) //!< Most significant byte of 2nd rank of \a u32. -# define MSB0(u32) MSB0W(u32) //!< Most significant byte of 1st rank of \a u32. +#define LSB0(u32) LSB0W(u32) //!< Least significant byte of 1st rank of \a u32. +#define LSB1(u32) LSB1W(u32) //!< Least significant byte of 2nd rank of \a u32. +#define LSB2(u32) LSB2W(u32) //!< Least significant byte of 3rd rank of \a u32. +#define LSB3(u32) LSB3W(u32) //!< Least significant byte of 4th rank of \a u32. +#define MSB3(u32) MSB3W(u32) //!< Most significant byte of 4th rank of \a u32. +#define MSB2(u32) MSB2W(u32) //!< Most significant byte of 3rd rank of \a u32. +#define MSB1(u32) MSB1W(u32) //!< Most significant byte of 2nd rank of \a u32. +#define MSB0(u32) MSB0W(u32) //!< Most significant byte of 1st rank of \a u32. -# if defined(__ICCARM__) -# define SHORTENUM __packed -# elif defined(__GNUC__) -# define SHORTENUM __attribute__((packed)) -# endif +#if defined(__ICCARM__) +# define SHORTENUM __packed +#elif defined(__GNUC__) +# define SHORTENUM __attribute__((packed)) +#endif /* No operation */ -# if defined(__ICCARM__) -# define nop() __no_operation() -# elif defined(__GNUC__) -# define nop() (__NOP()) -# endif +#if defined(__ICCARM__) +# define nop() __no_operation() +#elif defined(__GNUC__) +# define nop() (__NOP()) +#endif -# define FLASH_DECLARE(x) const x -# define FLASH_EXTERN(x) extern const x -# define PGM_READ_BYTE(x) *(x) -# define PGM_READ_WORD(x) *(x) -# define MEMCPY_ENDIAN memcpy -# define PGM_READ_BLOCK(dst, src, len) memcpy((dst), (src), (len)) +#define FLASH_DECLARE(x) const x +#define FLASH_EXTERN(x) extern const x +#define PGM_READ_BYTE(x) *(x) +#define PGM_READ_WORD(x) *(x) +#define MEMCPY_ENDIAN memcpy +#define PGM_READ_BLOCK(dst, src, len) memcpy((dst), (src), (len)) /*Defines the Flash Storage for the request and response of MAC*/ -# define CMD_ID_OCTET (0) +#define CMD_ID_OCTET (0) /* Converting of values from CPU endian to little endian. */ -# define CPU_ENDIAN_TO_LE16(x) (x) -# define CPU_ENDIAN_TO_LE32(x) (x) -# define CPU_ENDIAN_TO_LE64(x) (x) +#define CPU_ENDIAN_TO_LE16(x) (x) +#define CPU_ENDIAN_TO_LE32(x) (x) +#define CPU_ENDIAN_TO_LE64(x) (x) /* Converting of values from little endian to CPU endian. */ -# define LE16_TO_CPU_ENDIAN(x) (x) -# define LE32_TO_CPU_ENDIAN(x) (x) -# define LE64_TO_CPU_ENDIAN(x) (x) +#define LE16_TO_CPU_ENDIAN(x) (x) +#define LE32_TO_CPU_ENDIAN(x) (x) +#define LE64_TO_CPU_ENDIAN(x) (x) /* Converting of constants from little endian to CPU endian. */ -# define CLE16_TO_CPU_ENDIAN(x) (x) -# define CLE32_TO_CPU_ENDIAN(x) (x) -# define CLE64_TO_CPU_ENDIAN(x) (x) +#define CLE16_TO_CPU_ENDIAN(x) (x) +#define CLE32_TO_CPU_ENDIAN(x) (x) +#define CLE64_TO_CPU_ENDIAN(x) (x) /* Converting of constants from CPU endian to little endian. */ -# define CCPU_ENDIAN_TO_LE16(x) (x) -# define CCPU_ENDIAN_TO_LE32(x) (x) -# define CCPU_ENDIAN_TO_LE64(x) (x) +#define CCPU_ENDIAN_TO_LE16(x) (x) +#define CCPU_ENDIAN_TO_LE32(x) (x) +#define CCPU_ENDIAN_TO_LE64(x) (x) -# define ADDR_COPY_DST_SRC_16(dst, src) ((dst) = (src)) -# define ADDR_COPY_DST_SRC_64(dst, src) ((dst) = (src)) +#define ADDR_COPY_DST_SRC_16(dst, src) ((dst) = (src)) +#define ADDR_COPY_DST_SRC_64(dst, src) ((dst) = (src)) /** * @brief Converts a 64-Bit value into a 8 Byte array diff --git a/tmk_core/protocol/arm_atsam/usb/udi_cdc.c b/tmk_core/protocol/arm_atsam/usb/udi_cdc.c index 27db4017c4..322a32ebcc 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_cdc.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_cdc.c @@ -89,14 +89,14 @@ * * @{ */ -bool udi_cdc_comm_enable(void); -void udi_cdc_comm_disable(void); -bool udi_cdc_comm_setup(void); -bool udi_cdc_data_enable(void); -void udi_cdc_data_disable(void); -bool udi_cdc_data_setup(void); -uint8_t udi_cdc_getsetting(void); -void udi_cdc_data_sof_notify(void); +bool udi_cdc_comm_enable(void); +void udi_cdc_comm_disable(void); +bool udi_cdc_comm_setup(void); +bool udi_cdc_data_enable(void); +void udi_cdc_data_disable(void); +bool udi_cdc_data_setup(void); +uint8_t udi_cdc_getsetting(void); +void udi_cdc_data_sof_notify(void); UDC_DESC_STORAGE udi_api_t udi_api_cdc_comm = {.enable = udi_cdc_comm_enable, .disable = udi_cdc_comm_disable, .setup = udi_cdc_comm_setup, .getsetting = udi_cdc_getsetting, .sof_notify = NULL}; UDC_DESC_STORAGE udi_api_t udi_api_cdc_data = { .enable = udi_cdc_data_enable, diff --git a/tmk_core/protocol/arm_atsam/usb/usb_device_udd.c b/tmk_core/protocol/arm_atsam/usb/usb_device_udd.c index f138b42786..b3d9cba826 100644 --- a/tmk_core/protocol/arm_atsam/usb/usb_device_udd.c +++ b/tmk_core/protocol/arm_atsam/usb/usb_device_udd.c @@ -596,11 +596,10 @@ void udd_set_address(uint8_t address) { usb_device_set_address(&usb_device, addr uint8_t udd_getaddress(void) { return usb_device_get_address(&usb_device); } void udd_send_remotewakeup(void) { - uint32_t try - = 5; + uint32_t try = 5; udd_wait_clock_ready(); udd_sleep_mode(UDD_STATE_IDLE); - while (2 != usb_get_state_machine_status(&usb_device) && try --) { + while (2 != usb_get_state_machine_status(&usb_device) && try--) { usb_device_send_remote_wake_up(&usb_device); } } From 6ad86042fedf80ed31f0696759750f2f8aa033e3 Mon Sep 17 00:00:00 2001 From: jack <59737601+waffle87@users.noreply.github.com> Date: Mon, 21 Feb 2022 10:57:13 -0700 Subject: [PATCH 12/14] Fix kikoslab/ellora65 (#16415) --- .../ellora65/keymaps/default/keymap.c | 16 ++++++----- .../kikoslab/ellora65/keymaps/via/keymap.c | 27 ++++++++++--------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/keyboards/kikoslab/ellora65/keymaps/default/keymap.c b/keyboards/kikoslab/ellora65/keymaps/default/keymap.c index bf18fe87de..e904026b8e 100644 --- a/keyboards/kikoslab/ellora65/keymaps/default/keymap.c +++ b/keyboards/kikoslab/ellora65/keymaps/default/keymap.c @@ -23,19 +23,21 @@ enum _layer { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_MA] = LAYOUT_all( + [_MA] = LAYOUT_all( KC_MUTE, KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , KC_BSPC, KC_BSPC, KC_F13 , KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, KC_BSLS, KC_F14 , KC_CAPS, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , KC_ENT , KC_INS, KC_F15 , KC_LSFT, KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_UP , KC_DEL, - KC_F16 , KC_LCTL, KC_LGUI, KC_LALT, MO(_FN) , KC_SPC , MO(_FN) , MO(_FN), MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT), + KC_F16 , KC_LCTL, KC_LGUI, KC_LALT, MO(_FN) , KC_SPC , MO(_FN) , MO(_FN), MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT + ), - [_FN] = LAYOUT_all( + [_FN] = LAYOUT_all( KC_DEL , KC_GRV , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_BSPC, KC_TRNS, KC_F17 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F18 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F19 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_F20 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + KC_F20 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) }; bool encoder_update_user(uint8_t index, bool clockwise) { @@ -197,7 +199,7 @@ static void print_status_narrow(void) { } -void oled_task_user(void) { +bool oled_task_user(void) { /* KEYBOARD PET VARIABLES START */ current_wpm = get_current_wpm(); @@ -206,7 +208,7 @@ void oled_task_user(void) { /* KEYBOARD PET VARIABLES END */ print_status_narrow(); - + return false; } bool process_record_user(uint16_t keycode, keyrecord_t *record) { @@ -237,4 +239,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } -#endif \ No newline at end of file +#endif diff --git a/keyboards/kikoslab/ellora65/keymaps/via/keymap.c b/keyboards/kikoslab/ellora65/keymaps/via/keymap.c index 707abaf6ba..fbe101d3d1 100644 --- a/keyboards/kikoslab/ellora65/keymaps/via/keymap.c +++ b/keyboards/kikoslab/ellora65/keymaps/via/keymap.c @@ -17,34 +17,37 @@ along with this program. If not, see . #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [0] = LAYOUT_all( + [0] = LAYOUT_all( KC_MUTE, KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , KC_BSPC, KC_BSPC, KC_F13 , KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, KC_BSLS, KC_F14 , KC_CAPS, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , KC_ENT , KC_INS, KC_F15 , KC_LSFT, KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_UP , KC_DEL, - KC_F16 , KC_LCTL, KC_LGUI, KC_LALT, MO(1) , KC_SPC , MO(1) , MO(1) , MO(1) , KC_LEFT, KC_DOWN, KC_RGHT), + KC_F16 , KC_LCTL, KC_LGUI, KC_LALT, MO(1) , KC_SPC , MO(1) , MO(1) , MO(1) , KC_LEFT, KC_DOWN, KC_RGHT + ), - [1] = LAYOUT_all( + [1] = LAYOUT_all( KC_DEL , KC_GRV , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_BSPC, KC_TRNS, KC_F17 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F18 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F19 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_F20 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_F20 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), - [2] = LAYOUT_all( + [2] = LAYOUT_all( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, KC_TRNS, KC_F17 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F18 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F19 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_F20 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_F20 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), - [3] = LAYOUT_all( + [3] = LAYOUT_all( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, KC_TRNS, KC_F17 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F18 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F19 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_F20 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + KC_F20 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) }; bool encoder_update_user(uint8_t index, bool clockwise) { @@ -206,7 +209,7 @@ static void print_status_narrow(void) { } -void oled_task_user(void) { +bool oled_task_user(void) { /* KEYBOARD PET VARIABLES START */ current_wpm = get_current_wpm(); @@ -215,7 +218,7 @@ void oled_task_user(void) { /* KEYBOARD PET VARIABLES END */ print_status_narrow(); - + return false; } bool process_record_user(uint16_t keycode, keyrecord_t *record) { @@ -246,4 +249,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } -#endif \ No newline at end of file +#endif From 302ed624ac0910eea80ff4376dc2b8df5fd94b3f Mon Sep 17 00:00:00 2001 From: Danny Date: Mon, 21 Feb 2022 13:02:30 -0500 Subject: [PATCH 13/14] Add encoder defaults for Keebio boards (#16398) * Add BDN9 encoder defaults * Add DSP40 encoder default * Add FoldKB encoder defaults * Add Iris encoder defaults * Update Iris Rev. 6 encoder orientation * Add KBO-5000 encoder defaults * Add Quefrency encoder defaults * Add Sinc encoder defaults * Add Stick encoder defaults * Remove encoder settings from VIA keymaps --- .../keebio/bdn9/keymaps/default/keymap.c | 2 +- keyboards/keebio/bdn9/keymaps/via/keymap.c | 25 ------------------ keyboards/keebio/bdn9/rev1/rev1.c | 26 +++++++++++++++++++ keyboards/keebio/bdn9/rev2/rev2.c | 26 +++++++++++++++++++ .../keebio/dsp40/keymaps/default/keymap.c | 2 +- keyboards/keebio/dsp40/keymaps/via/keymap.c | 11 -------- keyboards/keebio/dsp40/rev1/rev1.c | 12 +++++++++ .../keebio/foldkb/keymaps/default/keymap.c | 17 ------------ keyboards/keebio/foldkb/keymaps/via/keymap.c | 17 ------------ keyboards/keebio/foldkb/rev1/rev1.c | 18 +++++++++++++ .../keebio/iris/keymaps/default/keymap.c | 2 +- keyboards/keebio/iris/keymaps/via/keymap.c | 18 ------------- keyboards/keebio/iris/rev3/rev3.c | 18 +++++++++++++ keyboards/keebio/iris/rev4/rev4.c | 18 +++++++++++++ keyboards/keebio/iris/rev5/rev5.c | 18 +++++++++++++ keyboards/keebio/iris/rev6/config.h | 8 +++--- keyboards/keebio/iris/rev6/rev6.c | 18 +++++++++++++ .../keebio/kbo5000/keymaps/default/keymap.c | 2 +- keyboards/keebio/kbo5000/keymaps/via/keymap.c | 23 ---------------- keyboards/keebio/kbo5000/rev1/rev1.c | 24 +++++++++++++++++ .../quefrency/keymaps/default65/keymap.c | 2 +- .../quefrency/keymaps/default65macro/keymap.c | 2 +- .../keebio/quefrency/keymaps/via/keymap.c | 17 ------------ keyboards/keebio/quefrency/rev2/rev2.c | 18 +++++++++++++ keyboards/keebio/quefrency/rev3/rev3.c | 18 +++++++++++++ keyboards/keebio/quefrency/rev4/rev4.c | 18 +++++++++++++ .../keebio/sinc/keymaps/default/keymap.c | 2 +- keyboards/keebio/sinc/keymaps/via/keymap.c | 17 ------------ keyboards/keebio/sinc/rev1/rev1.c | 18 +++++++++++++ keyboards/keebio/sinc/rev2/rev2.c | 18 +++++++++++++ .../keebio/stick/keymaps/default/keymap.c | 2 +- keyboards/keebio/stick/keymaps/via/keymap.c | 18 ------------- keyboards/keebio/stick/stick.c | 18 +++++++++++++ 33 files changed, 298 insertions(+), 175 deletions(-) diff --git a/keyboards/keebio/bdn9/keymaps/default/keymap.c b/keyboards/keebio/bdn9/keymaps/default/keymap.c index e33e94b536..1dc680a1f6 100644 --- a/keyboards/keebio/bdn9/keymaps/default/keymap.c +++ b/keyboards/keebio/bdn9/keymaps/default/keymap.c @@ -67,5 +67,5 @@ bool encoder_update_user(uint8_t index, bool clockwise) { tap_code(KC_PGUP); } } - return true; + return false; } diff --git a/keyboards/keebio/bdn9/keymaps/via/keymap.c b/keyboards/keebio/bdn9/keymaps/via/keymap.c index 7c380a4fdd..655f3e5ed4 100644 --- a/keyboards/keebio/bdn9/keymaps/via/keymap.c +++ b/keyboards/keebio/bdn9/keymaps/via/keymap.c @@ -40,28 +40,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; - -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == _LEFT) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - else if (index == _MIDDLE) { - if (clockwise) { - tap_code(KC_DOWN); - } else { - tap_code(KC_UP); - } - } - else if (index == _RIGHT) { - if (clockwise) { - tap_code(KC_PGDN); - } else { - tap_code(KC_PGUP); - } - } - return true; -} diff --git a/keyboards/keebio/bdn9/rev1/rev1.c b/keyboards/keebio/bdn9/rev1/rev1.c index 4b32b73a0b..b1b0afc608 100644 --- a/keyboards/keebio/bdn9/rev1/rev1.c +++ b/keyboards/keebio/bdn9/rev1/rev1.c @@ -16,3 +16,29 @@ void eeconfig_init_kb(void) { eeconfig_update_kb(0); eeconfig_init_user(); } + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + else if (index == 1) { + if (clockwise) { + tap_code(KC_DOWN); + } else { + tap_code(KC_UP); + } + } + else if (index == 2) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } + return false; +} diff --git a/keyboards/keebio/bdn9/rev2/rev2.c b/keyboards/keebio/bdn9/rev2/rev2.c index 689abd0b1d..9c2f5169f3 100644 --- a/keyboards/keebio/bdn9/rev2/rev2.c +++ b/keyboards/keebio/bdn9/rev2/rev2.c @@ -37,3 +37,29 @@ void eeconfig_init_kb(void) { eeconfig_update_kb(0); eeconfig_init_user(); } + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + else if (index == 1) { + if (clockwise) { + tap_code(KC_DOWN); + } else { + tap_code(KC_UP); + } + } + else if (index == 2) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } + return false; +} diff --git a/keyboards/keebio/dsp40/keymaps/default/keymap.c b/keyboards/keebio/dsp40/keymaps/default/keymap.c index f9bf6c27c5..a4f65f5f48 100755 --- a/keyboards/keebio/dsp40/keymaps/default/keymap.c +++ b/keyboards/keebio/dsp40/keymaps/default/keymap.c @@ -113,5 +113,5 @@ bool encoder_update_user(uint8_t index, bool clockwise) { tap_code(KC_VOLD); } } - return true; + return false; } diff --git a/keyboards/keebio/dsp40/keymaps/via/keymap.c b/keyboards/keebio/dsp40/keymaps/via/keymap.c index 6575bbc8c6..f2f87663c5 100755 --- a/keyboards/keebio/dsp40/keymaps/via/keymap.c +++ b/keyboards/keebio/dsp40/keymaps/via/keymap.c @@ -63,14 +63,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; - -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return true; -} diff --git a/keyboards/keebio/dsp40/rev1/rev1.c b/keyboards/keebio/dsp40/rev1/rev1.c index 04c85b08d1..41187b90b6 100644 --- a/keyboards/keebio/dsp40/rev1/rev1.c +++ b/keyboards/keebio/dsp40/rev1/rev1.c @@ -24,3 +24,15 @@ void eeconfig_init_kb(void) { eeconfig_update_kb(0); eeconfig_init_user(); } + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + return false; +} diff --git a/keyboards/keebio/foldkb/keymaps/default/keymap.c b/keyboards/keebio/foldkb/keymaps/default/keymap.c index 0a71ef4d2d..45bc1673e2 100644 --- a/keyboards/keebio/foldkb/keymaps/default/keymap.c +++ b/keyboards/keebio/foldkb/keymaps/default/keymap.c @@ -32,20 +32,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_VOLD, _______, _______, _______, _______, _______, _______, _______, KC_0, _______, _______, _______, _______ ), }; - -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } else if (index == 1) { - if (clockwise) { - tap_code(KC_PGDN); - } else { - tap_code(KC_PGUP); - } - } - return true; -} diff --git a/keyboards/keebio/foldkb/keymaps/via/keymap.c b/keyboards/keebio/foldkb/keymaps/via/keymap.c index d3e3a95bf6..85d6912760 100644 --- a/keyboards/keebio/foldkb/keymaps/via/keymap.c +++ b/keyboards/keebio/foldkb/keymaps/via/keymap.c @@ -46,20 +46,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; - -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } else if (index == 1) { - if (clockwise) { - tap_code(KC_PGDN); - } else { - tap_code(KC_PGUP); - } - } - return true; -} diff --git a/keyboards/keebio/foldkb/rev1/rev1.c b/keyboards/keebio/foldkb/rev1/rev1.c index bab2674003..a0dfb31b52 100644 --- a/keyboards/keebio/foldkb/rev1/rev1.c +++ b/keyboards/keebio/foldkb/rev1/rev1.c @@ -24,3 +24,21 @@ void eeconfig_init_kb(void) { eeconfig_update_kb(0); eeconfig_init_user(); } + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } + return false; +} diff --git a/keyboards/keebio/iris/keymaps/default/keymap.c b/keyboards/keebio/iris/keymaps/default/keymap.c index e3cd532694..169e5b50c7 100644 --- a/keyboards/keebio/iris/keymaps/default/keymap.c +++ b/keyboards/keebio/iris/keymaps/default/keymap.c @@ -127,5 +127,5 @@ bool encoder_update_user(uint8_t index, bool clockwise) { tap_code(KC_PGUP); } } - return true; + return false; } diff --git a/keyboards/keebio/iris/keymaps/via/keymap.c b/keyboards/keebio/iris/keymaps/via/keymap.c index f6183f1f7d..0a71bad92b 100644 --- a/keyboards/keebio/iris/keymaps/via/keymap.c +++ b/keyboards/keebio/iris/keymaps/via/keymap.c @@ -65,21 +65,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // └────────┴────────┴────────┘ └────────┴────────┴────────┘ ) }; - -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - else if (index == 1) { - if (clockwise) { - tap_code(KC_PGDN); - } else { - tap_code(KC_PGUP); - } - } - return true; -} diff --git a/keyboards/keebio/iris/rev3/rev3.c b/keyboards/keebio/iris/rev3/rev3.c index b97b097b78..e874b9beae 100644 --- a/keyboards/keebio/iris/rev3/rev3.c +++ b/keyboards/keebio/iris/rev3/rev3.c @@ -35,3 +35,21 @@ void eeconfig_init_kb(void) { eeconfig_update_kb(0); eeconfig_init_user(); } + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } + return false; +} diff --git a/keyboards/keebio/iris/rev4/rev4.c b/keyboards/keebio/iris/rev4/rev4.c index de2ba26db3..36ef461cd0 100644 --- a/keyboards/keebio/iris/rev4/rev4.c +++ b/keyboards/keebio/iris/rev4/rev4.c @@ -16,3 +16,21 @@ void eeconfig_init_kb(void) { eeconfig_update_kb(0); eeconfig_init_user(); } + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } + return false; +} diff --git a/keyboards/keebio/iris/rev5/rev5.c b/keyboards/keebio/iris/rev5/rev5.c index a4191719c0..2a89c6923b 100644 --- a/keyboards/keebio/iris/rev5/rev5.c +++ b/keyboards/keebio/iris/rev5/rev5.c @@ -12,3 +12,21 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "rev5.h" + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } + return false; +} diff --git a/keyboards/keebio/iris/rev6/config.h b/keyboards/keebio/iris/rev6/config.h index 386416f113..e26dc5fa50 100644 --- a/keyboards/keebio/iris/rev6/config.h +++ b/keyboards/keebio/iris/rev6/config.h @@ -36,10 +36,10 @@ along with this program. If not, see . #define MATRIX_COL_PINS_RIGHT { D4, D6, D7, C7, F1, F4 } #define SPLIT_HAND_PIN D5 -#define ENCODERS_PAD_A { B2 } -#define ENCODERS_PAD_B { B3 } -#define ENCODERS_PAD_A_RIGHT { B2 } -#define ENCODERS_PAD_B_RIGHT { B3 } +#define ENCODERS_PAD_A { B3 } +#define ENCODERS_PAD_B { B2 } +#define ENCODERS_PAD_A_RIGHT { B3 } +#define ENCODERS_PAD_B_RIGHT { B2 } /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW diff --git a/keyboards/keebio/iris/rev6/rev6.c b/keyboards/keebio/iris/rev6/rev6.c index ff9f9d25a1..152df0b2f9 100644 --- a/keyboards/keebio/iris/rev6/rev6.c +++ b/keyboards/keebio/iris/rev6/rev6.c @@ -63,3 +63,21 @@ led_config_t g_led_config = { { } }; #endif + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } + return false; +} diff --git a/keyboards/keebio/kbo5000/keymaps/default/keymap.c b/keyboards/keebio/kbo5000/keymaps/default/keymap.c index 0261d11915..d2881206d6 100644 --- a/keyboards/keebio/kbo5000/keymaps/default/keymap.c +++ b/keyboards/keebio/kbo5000/keymaps/default/keymap.c @@ -55,5 +55,5 @@ bool encoder_update_user(uint8_t index, bool clockwise) { tap_code(KC_UP); } } - return true; + return false; } diff --git a/keyboards/keebio/kbo5000/keymaps/via/keymap.c b/keyboards/keebio/kbo5000/keymaps/via/keymap.c index 11075faf6f..a7fd62dddb 100644 --- a/keyboards/keebio/kbo5000/keymaps/via/keymap.c +++ b/keyboards/keebio/kbo5000/keymaps/via/keymap.c @@ -34,26 +34,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; - -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == LEFT_HALF_ENC) { - if (clockwise) { - tap_code(KC_PGDN); - } else { - tap_code(KC_PGUP); - } - } else if (index == RIGHT_HALF_ENC1) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } else if (index == RIGHT_HALF_ENC2) { - if (clockwise) { - tap_code(KC_DOWN); - } else { - tap_code(KC_UP); - } - } - return true; -} diff --git a/keyboards/keebio/kbo5000/rev1/rev1.c b/keyboards/keebio/kbo5000/rev1/rev1.c index fafad9b6ab..757a8be2a1 100644 --- a/keyboards/keebio/kbo5000/rev1/rev1.c +++ b/keyboards/keebio/kbo5000/rev1/rev1.c @@ -30,3 +30,27 @@ void eeconfig_init_kb(void) { eeconfig_update_kb(0); eeconfig_init_user(); } + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } else if (index == 1) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 2) { + if (clockwise) { + tap_code(KC_DOWN); + } else { + tap_code(KC_UP); + } + } + return false; +} diff --git a/keyboards/keebio/quefrency/keymaps/default65/keymap.c b/keyboards/keebio/quefrency/keymaps/default65/keymap.c index 0ae9d50e20..481de2aa00 100644 --- a/keyboards/keebio/quefrency/keymaps/default65/keymap.c +++ b/keyboards/keebio/quefrency/keymaps/default65/keymap.c @@ -46,5 +46,5 @@ bool encoder_update_user(uint8_t index, bool clockwise) { tap_code(KC_VOLD); } } - return true; + return false; } diff --git a/keyboards/keebio/quefrency/keymaps/default65macro/keymap.c b/keyboards/keebio/quefrency/keymaps/default65macro/keymap.c index 86f6911779..f452232b2d 100644 --- a/keyboards/keebio/quefrency/keymaps/default65macro/keymap.c +++ b/keyboards/keebio/quefrency/keymaps/default65macro/keymap.c @@ -46,5 +46,5 @@ bool encoder_update_user(uint8_t index, bool clockwise) { tap_code(KC_VOLD); } } - return true; + return false; } diff --git a/keyboards/keebio/quefrency/keymaps/via/keymap.c b/keyboards/keebio/quefrency/keymaps/via/keymap.c index 213f7af325..5ac83ef57c 100644 --- a/keyboards/keebio/quefrency/keymaps/via/keymap.c +++ b/keyboards/keebio/quefrency/keymaps/via/keymap.c @@ -33,20 +33,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; - -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { - if (clockwise) { - tap_code(KC_PGDN); - } else { - tap_code(KC_PGUP); - } - } else if (index == 1) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return true; -} diff --git a/keyboards/keebio/quefrency/rev2/rev2.c b/keyboards/keebio/quefrency/rev2/rev2.c index 69edfd415f..590c9850c2 100644 --- a/keyboards/keebio/quefrency/rev2/rev2.c +++ b/keyboards/keebio/quefrency/rev2/rev2.c @@ -30,3 +30,21 @@ void eeconfig_init_kb(void) { eeconfig_update_kb(0); eeconfig_init_user(); } + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } else if (index == 1) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + return false; +} diff --git a/keyboards/keebio/quefrency/rev3/rev3.c b/keyboards/keebio/quefrency/rev3/rev3.c index 40771e2c68..0f8f964d92 100644 --- a/keyboards/keebio/quefrency/rev3/rev3.c +++ b/keyboards/keebio/quefrency/rev3/rev3.c @@ -46,3 +46,21 @@ void eeconfig_init_kb(void) { eeconfig_update_kb(0); eeconfig_init_user(); } + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } else if (index == 1) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + return false; +} diff --git a/keyboards/keebio/quefrency/rev4/rev4.c b/keyboards/keebio/quefrency/rev4/rev4.c index a66d19166d..190135420f 100644 --- a/keyboards/keebio/quefrency/rev4/rev4.c +++ b/keyboards/keebio/quefrency/rev4/rev4.c @@ -15,3 +15,21 @@ along with this program. If not, see . */ #include "quefrency.h" + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } else if (index == 1) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + return false; +} diff --git a/keyboards/keebio/sinc/keymaps/default/keymap.c b/keyboards/keebio/sinc/keymaps/default/keymap.c index 650314295b..060bf5dc6c 100644 --- a/keyboards/keebio/sinc/keymaps/default/keymap.c +++ b/keyboards/keebio/sinc/keymaps/default/keymap.c @@ -33,5 +33,5 @@ bool encoder_update_user(uint8_t index, bool clockwise) { tap_code(KC_VOLD); } } - return true; + return false; } diff --git a/keyboards/keebio/sinc/keymaps/via/keymap.c b/keyboards/keebio/sinc/keymaps/via/keymap.c index 20cfdd79bb..225e9c07df 100644 --- a/keyboards/keebio/sinc/keymaps/via/keymap.c +++ b/keyboards/keebio/sinc/keymaps/via/keymap.c @@ -37,20 +37,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; - -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { - if (clockwise) { - tap_code(KC_PGDN); - } else { - tap_code(KC_PGUP); - } - } else if (index == 1) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return true; -} diff --git a/keyboards/keebio/sinc/rev1/rev1.c b/keyboards/keebio/sinc/rev1/rev1.c index 562a245344..906b9b7d58 100644 --- a/keyboards/keebio/sinc/rev1/rev1.c +++ b/keyboards/keebio/sinc/rev1/rev1.c @@ -22,3 +22,21 @@ void eeconfig_init_kb(void) { eeconfig_update_kb(0); eeconfig_init_user(); } + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } else if (index == 1) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + return false; +} diff --git a/keyboards/keebio/sinc/rev2/rev2.c b/keyboards/keebio/sinc/rev2/rev2.c index aea877d83c..47bb1e9e68 100644 --- a/keyboards/keebio/sinc/rev2/rev2.c +++ b/keyboards/keebio/sinc/rev2/rev2.c @@ -38,3 +38,21 @@ void eeconfig_init_kb(void) { eeconfig_update_kb(0); eeconfig_init_user(); } + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } else if (index == 1) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + return false; +} diff --git a/keyboards/keebio/stick/keymaps/default/keymap.c b/keyboards/keebio/stick/keymaps/default/keymap.c index ea4ca3f54f..8e9b43a14a 100644 --- a/keyboards/keebio/stick/keymaps/default/keymap.c +++ b/keyboards/keebio/stick/keymaps/default/keymap.c @@ -39,5 +39,5 @@ bool encoder_update_user(uint8_t index, bool clockwise) { tap_code(KC_UP); } } - return true; + return false; } diff --git a/keyboards/keebio/stick/keymaps/via/keymap.c b/keyboards/keebio/stick/keymaps/via/keymap.c index 3f196dda69..752b2de054 100644 --- a/keyboards/keebio/stick/keymaps/via/keymap.c +++ b/keyboards/keebio/stick/keymaps/via/keymap.c @@ -35,21 +35,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), }; - -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - else if (index == 1) { - if (clockwise) { - tap_code(KC_DOWN); - } else { - tap_code(KC_UP); - } - } - return true; -} diff --git a/keyboards/keebio/stick/stick.c b/keyboards/keebio/stick/stick.c index 050c4eff81..c2d25f8860 100644 --- a/keyboards/keebio/stick/stick.c +++ b/keyboards/keebio/stick/stick.c @@ -48,3 +48,21 @@ void eeconfig_init_kb(void) { eeconfig_update_kb(0); eeconfig_init_user(); } + +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { + if (clockwise) { + tap_code(KC_DOWN); + } else { + tap_code(KC_UP); + } + } + return false; +} From 31f590066646b0be76d3ba9bb1b38174b46d507f Mon Sep 17 00:00:00 2001 From: jack <59737601+waffle87@users.noreply.github.com> Date: Mon, 21 Feb 2022 11:04:14 -0700 Subject: [PATCH 14/14] fix layout macro (#16414) Co-authored-by: jack <{ID}+{username}@users.noreply.github.com> --- keyboards/creatkeebs/glacier/glacier.h | 12 ++++++------ .../creatkeebs/glacier/keymaps/default/keymap.c | 3 --- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/keyboards/creatkeebs/glacier/glacier.h b/keyboards/creatkeebs/glacier/glacier.h index 2dcf15fc98..3b7b1320f5 100644 --- a/keyboards/creatkeebs/glacier/glacier.h +++ b/keyboards/creatkeebs/glacier/glacier.h @@ -21,15 +21,15 @@ #define LAYOUT( \ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ - K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K315, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, \ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K413, K415, \ K500, K501, K502, K505, K510, K511, K513, K514, K515, K516 \ ) { \ { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016 }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 K115, K116 }, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 K215, K216 }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO KC_NO, KC_NO }, \ - { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, KC_NO, K413, KC_NO K415, KC_NO }, \ - { K500, K501, K502, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, KC_NO, K510, K511, KC_NO, K513, K514 K515, K516 } \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO, KC_NO, KC_NO }, \ + { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, KC_NO, K413, KC_NO, K415, KC_NO }, \ + { K500, K501, K502, KC_NO, KC_NO, K505, KC_NO, KC_NO, KC_NO, KC_NO, K510, K511, KC_NO, K513, K514, K515, K516 } \ } diff --git a/keyboards/creatkeebs/glacier/keymaps/default/keymap.c b/keyboards/creatkeebs/glacier/keymaps/default/keymap.c index ee381e17cc..e58d790545 100644 --- a/keyboards/creatkeebs/glacier/keymaps/default/keymap.c +++ b/keyboards/creatkeebs/glacier/keymaps/default/keymap.c @@ -17,9 +17,6 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - - [0] = LAYOUT( KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_PSCR, KC_SLCK, KC_PAUS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP,