summaryrefslogtreecommitdiffstats
path: root/keyboards/system76/launch_1
diff options
context:
space:
mode:
authorlokher <lokher@gmail.com>2022-12-06 17:10:48 +0800
committerlokher <lokher@gmail.com>2022-12-07 15:50:49 +0800
commita336c2c5005251e4cb0f3a62ccabdb4cfccad915 (patch)
tree3c948b631a5e3b6f940dabe02fad3c7487e6f350 /keyboards/system76/launch_1
parent27fc28fd2ff52e079a5bc58d6aaea4c752420615 (diff)
Merge upstream master to 2022 Q4 breaking change
Diffstat (limited to 'keyboards/system76/launch_1')
-rw-r--r--keyboards/system76/launch_1/config.h111
-rw-r--r--keyboards/system76/launch_1/rgb_matrix_kb.inc157
2 files changed, 0 insertions, 268 deletions
diff --git a/keyboards/system76/launch_1/config.h b/keyboards/system76/launch_1/config.h
deleted file mode 100644
index 0431b9ab17..0000000000
--- a/keyboards/system76/launch_1/config.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) 2021 System76
- *
- * 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 3 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 <https://www.gnu.org/licenses/>.
- */
-
-#pragma once
-
-#include "config_common.h"
-
-// Key matrix size
-#define MATRIX_ROWS 6
-#define MATRIX_COLS 14
-
-/*
- * Key matrix pins
- * ROWS: AVR pins used for rows, top to bottom
- * COLS: AVR pins used for columns, left to right
- */
-#define MATRIX_ROW_PINS { F0, F1, F4, F5, F6, F7 }
-#define MATRIX_COL_PINS { D7, C7, C6, B6, B5, B4, D6, D4, E6, D5, D3, D2, B7, B0 }
-
-/*
- * Diode Direction
- * COL2ROW = COL => Anode (+), ROW => Cathode (-)
- * ROW2COL = ROW => Anode (+), COL => Cathode (-)
- */
-#define DIODE_DIRECTION COL2ROW
-
-// Set 0 if debouncing isn't needed
-#define DEBOUNCE 5
-
-#ifdef RGB_MATRIX_ENABLE
-# define RGB_DI_PIN E2
-# define RGB_MATRIX_LED_COUNT 84
-# define RGB_MATRIX_KEYPRESSES // Reacts to keypresses
-// # define RGB_MATRIX_KEYRELEASES // Reacts to keyreleases (instead of keypresses)
-// # define RGB_MATRIX_FRAMEBUFFER_EFFECTS // Enables framebuffer effects
-# define RGB_DISABLE_WHEN_USB_SUSPENDED // Turns off effects when suspended
-// Limit brightness to support USB-A at 0.5 A
-// TODO: Do this dynamically based on power source
-# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 176 // Limits maximum brightness of LEDs to 176 out of 255. If not defined, maximum brightness is set to 255
-# define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_RAINBOW_MOVING_CHEVRON // Sets the default mode, if none has been set
-# define RGB_MATRIX_DEFAULT_HUE 142 // Sets the default hue value, if none has been set
-# define RGB_MATRIX_DEFAULT_SAT 255 // Sets the default saturation value, if none has been set
-# define RGB_MATRIX_DEFAULT_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS // Sets the default brightness value, if none has been set
-# define RGB_MATRIX_DEFAULT_SPD 127 // Sets the default animation speed, if none has been set
-# define RGB_MATRIX_DISABLE_KEYCODES // Disables control of rgb matrix by keycodes (must use code functions to control the feature)
-
-# define ENABLE_RGB_MATRIX_CYCLE_ALL
-# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
-# define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
-# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
-# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
-# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
-# define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
-# define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
-# define ENABLE_RGB_MATRIX_RAINDROPS
-# define ENABLE_RGB_MATRIX_SPLASH
-# define ENABLE_RGB_MATRIX_MULTISPLASH
-#endif // RGB_MATRIX_ENABLE
-
-// 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
-
-// I2C {
-#define F_SCL 100000UL // Run I2C bus at 100 kHz
-#define I2C_START_RETRY_COUNT 20
-#define I2C_TIMEOUT 100 // milliseconds
-// } I2C
-
-// EEPROM {
-#define EEPROM_SIZE 1024
-// TODO: Refactor with new user EEPROM code (coming soon)
-#define EEPROM_MAGIC 0x76EC
-#define EEPROM_MAGIC_ADDR 64
-// Bump this every time we change what we store
-// This will automatically reset the EEPROM with defaults
-// and avoid loading invalid data from the EEPROM
-#define EEPROM_VERSION 0x02
-#define EEPROM_VERSION_ADDR (EEPROM_MAGIC_ADDR + 2)
-// } EEPROM
-
-// Dynamic keymap {
-#define DYNAMIC_KEYMAP_LAYER_COUNT 4
-#define DYNAMIC_KEYMAP_MACRO_COUNT 0
-// Dynamic keymap starts after EEPROM version
-#define DYNAMIC_KEYMAP_EEPROM_ADDR (EEPROM_VERSION_ADDR + 1)
-// Dynamic macro starts after dynamic keymaps, it is disabled
-#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR (DYNAMIC_KEYMAP_EEPROM_ADDR + (DYNAMIC_KEYMAP_LAYER_COUNT * MATRIX_ROWS * MATRIX_COLS * 2))
-#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 0
-// } Dynamic keymap
-
-// System76 EC {
-#define SYSTEM76_EC_EEPROM_ADDR (DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE)
-#define SYSTEM76_EC_EEPROM_SIZE (EEPROM_SIZE - SYSTEM76_EC_EEPROM_ADDR)
-// } System76 EC
diff --git a/keyboards/system76/launch_1/rgb_matrix_kb.inc b/keyboards/system76/launch_1/rgb_matrix_kb.inc
deleted file mode 100644
index 02de10ed50..0000000000
--- a/keyboards/system76/launch_1/rgb_matrix_kb.inc
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (C) 2021 System76
- *
- * 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 3 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 <https://www.gnu.org/licenses/>.
- */
-
-RGB_MATRIX_EFFECT(active_keys)
-RGB_MATRIX_EFFECT(raw_rgb)
-RGB_MATRIX_EFFECT(unlocked)
-
-#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
-
-#include "dynamic_keymap.h"
-
-static bool active_keys_initialized = false;
-static uint8_t active_keys_table[RGB_MATRIX_LED_COUNT] = {0};
-
-static void active_keys_initialize(void) {
- for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
- for (uint8_t col = 0; col < MATRIX_COLS; col++) {
- uint8_t led = g_led_config.matrix_co[row][col];
- if (led < RGB_MATRIX_LED_COUNT && row < 16 && col < 16) {
- active_keys_table[led] = (row << 4) | col;
- }
- }
- }
- active_keys_initialized = true;
-}
-
-static bool active_keys(effect_params_t* params) {
- if (!active_keys_initialized) {
- active_keys_initialize();
- }
-
- RGB_MATRIX_USE_LIMITS(led_min, led_max);
- uint8_t layer = get_highest_layer(layer_state);
- RGB rgb = hsv_to_rgb(rgb_matrix_config.hsv);
-
- for (uint8_t i = led_min; i < led_max; i++) {
- RGB_MATRIX_TEST_LED_FLAGS();
-
- uint8_t rowcol = active_keys_table[i];
- uint8_t row = rowcol >> 4;
- uint8_t col = rowcol & 0xF;
- uint16_t keycode = dynamic_keymap_get_keycode(layer, row, col);
- switch (keycode) {
- case KC_NO:
- case KC_TRNS:
- rgb_matrix_set_color(i, 0, 0, 0);
- break;
- default:
- rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
- break;
- }
- }
-
- return led_max < RGB_MATRIX_LED_COUNT;
-}
-
-RGB raw_rgb_data[RGB_MATRIX_LED_COUNT] = {0};
-
-static uint8_t normalize_component(uint8_t component) {
- uint16_t x = (uint16_t)component;
- x *= rgb_matrix_config.hsv.v; // Multiply by current brightness
- x /= 255; // Divide by maximum brightness
- return (uint8_t)x;
-}
-
-static RGB normalize_index(uint8_t i) {
- RGB raw = raw_rgb_data[i];
- RGB rgb = {
- .r = normalize_component(raw.r),
- .g = normalize_component(raw.g),
- .b = normalize_component(raw.b),
- };
- return rgb;
-}
-
-static bool raw_rgb(effect_params_t* params) {
- RGB_MATRIX_USE_LIMITS(led_min, led_max);
- for (uint8_t i = led_min; i < led_max; i++) {
- RGB_MATRIX_TEST_LED_FLAGS();
- RGB rgb = normalize_index(i);
- rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
- }
- return led_max < RGB_MATRIX_LED_COUNT;
-}
-
-static uint8_t unlocked_keys[8][2] = {
- {2, 7}, // U
- {4, 6}, // N
- {3, 9}, // L
- {2, 9}, // O
- {4, 3}, // C
- {3, 8}, // K
- {2, 3}, // E
- {3, 3}, // D
-};
-
-static uint8_t unlocked_ticks = 0;
-static uint8_t unlocked_i = 0;
-static uint8_t unlocked_leds_count = 0;
-static uint8_t unlocked_leds[2] = {0, 0};
-
-static bool unlocked(effect_params_t* params) {
- RGB_MATRIX_USE_LIMITS(led_min, led_max);
-
- unlocked_ticks++;
-
- if (params->init) {
- unlocked_ticks = 0;
- unlocked_i = 0;
- }
-
- if (unlocked_ticks == 0) {
- if (unlocked_i == 8) {
- unlocked_leds_count = 0;
- unlocked_i = 0;
- } else {
- unlocked_leds_count = rgb_matrix_map_row_column_to_led(unlocked_keys[unlocked_i][0], unlocked_keys[unlocked_i][1], unlocked_leds);
- unlocked_i++;
- }
- }
-
- for (uint8_t i = led_min; i < led_max; i++) {
- RGB_MATRIX_TEST_LED_FLAGS();
-
- HSV hsv = {
- .h = i + unlocked_ticks,
- .s = 0xFF,
- .v = 0x70,
- };
- for (uint8_t j = 0; j < unlocked_leds_count; j++) {
- if (i == unlocked_leds[j]) {
- hsv.s = 0;
- hsv.v = 0xFF;
- }
- }
-
- RGB rgb = hsv_to_rgb(hsv);
- rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
- }
- return led_max < RGB_MATRIX_LED_COUNT;
-}
-
-#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS