summaryrefslogtreecommitdiffstats
path: root/keyboards/work_louder/micro
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/work_louder/micro')
-rw-r--r--keyboards/work_louder/micro/keymaps/default/keymap.c91
-rw-r--r--keyboards/work_louder/micro/keymaps/default/rules.mk1
-rw-r--r--keyboards/work_louder/micro/keymaps/via/keymap.c92
-rw-r--r--keyboards/work_louder/micro/matrix.c131
-rw-r--r--keyboards/work_louder/micro/micro.c170
-rw-r--r--keyboards/work_louder/micro/micro.h22
-rw-r--r--keyboards/work_louder/micro/readme.md26
-rw-r--r--keyboards/work_louder/micro/rules.mk6
8 files changed, 0 insertions, 539 deletions
diff --git a/keyboards/work_louder/micro/keymaps/default/keymap.c b/keyboards/work_louder/micro/keymaps/default/keymap.c
deleted file mode 100644
index 6b5541e017..0000000000
--- a/keyboards/work_louder/micro/keymaps/default/keymap.c
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2022 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
-// SPDX-License-Identifier: GPL-2.0-or-later
-
-#include QMK_KEYBOARD_H
-
-enum custom_keycodes {
- LED_LEVEL = SAFE_RANGE,
-};
-
-const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
- LAYOUT(
- KC_MPLY, KC_9, KC_0, KC_NO,
- KC_5, KC_6, KC_7, KC_8,
- KC_1, KC_2, KC_3, KC_4,
- TO(1), KC_DOT, KC_COMM, LED_LEVEL
- ),
- LAYOUT(
- KC_1, KC_2, KC_3, KC_4,
- KC_5, KC_6, KC_7, KC_8,
- KC_9, KC_0, KC_A, KC_B,
- TO(2), KC_C, KC_D, KC_E
- ),
- LAYOUT(
- KC_1, KC_2, KC_3, KC_4,
- KC_5, KC_6, KC_7, KC_8,
- KC_9, KC_0, KC_A, KC_B,
- TO(3), KC_C, KC_D, KC_E
- ),
- LAYOUT(
- KC_1, KC_2, KC_3, KC_4,
- KC_5, KC_6, KC_7, KC_8,
- KC_9, KC_0, KC_A, KC_B,
- TO(0), KC_C, LED_LEVEL,KC_E
- ),
-
-};
-
-typedef union {
- uint32_t raw;
- struct {
- uint8_t led_level : 3;
- };
-} work_louder_config_t;
-
-work_louder_config_t work_louder_config;
-
-bool process_record_user(uint16_t keycode, keyrecord_t *record) {
- switch (keycode) {
- case LED_LEVEL:
- if (record->event.pressed) {
- work_louder_config.led_level++;
- if (work_louder_config.led_level > 4) {
- work_louder_config.led_level = 0;
- }
- work_louder_micro_led_all_set((uint8_t)(work_louder_config.led_level * 255 / 4));
- eeconfig_update_user(work_louder_config.raw);
- layer_state_set_kb(layer_state);
- }
- break;
- }
- return true;
-}
-
-#if defined(ENCODER_MAP_ENABLE)
-const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
- { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(C(KC_Z), C(KC_Y)) },
- { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) },
- { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) },
- { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) },
-};
-#endif
-
-
-layer_state_t layer_state_set_user(layer_state_t state) {
- layer_state_cmp(state, 1) ? work_louder_micro_led_1_on(): work_louder_micro_led_1_off();
- layer_state_cmp(state, 2) ? work_louder_micro_led_2_on(): work_louder_micro_led_2_off();
- layer_state_cmp(state, 3) ? work_louder_micro_led_3_on(): work_louder_micro_led_3_off();
-
- return state;
-}
-
-void eeconfig_init_user(void) {
- work_louder_config.raw = 0;
- work_louder_config.led_level = 1;
- eeconfig_update_user(work_louder_config.raw);
-}
-
-void matrix_init_user(void) {
- work_louder_config.raw = eeconfig_read_user();
- work_louder_micro_led_all_set((uint8_t)(work_louder_config.led_level * 255 / 4));
-}
diff --git a/keyboards/work_louder/micro/keymaps/default/rules.mk b/keyboards/work_louder/micro/keymaps/default/rules.mk
deleted file mode 100644
index ee32568148..0000000000
--- a/keyboards/work_louder/micro/keymaps/default/rules.mk
+++ /dev/null
@@ -1 +0,0 @@
-ENCODER_MAP_ENABLE = yes
diff --git a/keyboards/work_louder/micro/keymaps/via/keymap.c b/keyboards/work_louder/micro/keymaps/via/keymap.c
deleted file mode 100644
index da910af6b2..0000000000
--- a/keyboards/work_louder/micro/keymaps/via/keymap.c
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright 2022 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
-// SPDX-License-Identifier: GPL-2.0-or-later
-
-#include QMK_KEYBOARD_H
-
-const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
- LAYOUT(
- KC_MPLY, KC_9, KC_0, KC_NO,
- KC_5, KC_6, KC_7, KC_8,
- KC_1, KC_2, KC_3, KC_4,
- TO(1), KC_DOT, KC_COMM, USER09
- ),
- LAYOUT(
- _______, _______, _______, _______,
- _______, _______, _______, _______,
- _______, _______, _______, _______,
- TO(2), _______, _______, _______
-
- ),
- LAYOUT(
- _______, _______, _______, _______,
- _______, _______, _______, _______,
- _______, _______, _______, _______,
- TO(3), _______, _______, _______
- ),
- LAYOUT(
- _______, _______, _______, _______,
- _______, _______, _______, _______,
- _______, _______, _______, _______,
- TO(0), _______, _______, _______
- )
-};
-
-#if defined(ENCODER_MAP_ENABLE)
-const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
- { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(C(KC_Z), C(KC_Y)) },
- { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) },
- { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) },
- { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }
-};
-#endif
-
-
-typedef union {
- uint32_t raw;
- struct {
- uint8_t led_level : 3;
- };
-} work_louder_config_t;
-
-work_louder_config_t work_louder_config;
-
-bool process_record_user(uint16_t keycode, keyrecord_t *record) {
-#ifdef CONSOLE_ENABLE
- uprintf("KL: kc: 0x%04X, col: %2u, row: %2u, pressed: %b, time: %5u, int: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count);
-#endif
-
- switch (keycode) {
- case USER09:
- if (record->event.pressed) {
- work_louder_config.led_level++;
- if (work_louder_config.led_level > 4) {
- work_louder_config.led_level = 0;
- }
- work_louder_micro_led_all_set((uint8_t)(work_louder_config.led_level * 255 / 4));
- eeconfig_update_user(work_louder_config.raw);
- layer_state_set_kb(layer_state);
- }
- break;
- }
- return true;
-}
-
-
-layer_state_t layer_state_set_user(layer_state_t state) {
- layer_state_cmp(state, 1) ? work_louder_micro_led_1_on(): work_louder_micro_led_1_off();
- layer_state_cmp(state, 2) ? work_louder_micro_led_2_on(): work_louder_micro_led_2_off();
- layer_state_cmp(state, 3) ? work_louder_micro_led_3_on(): work_louder_micro_led_3_off();
-
- return state;
-}
-
-void eeconfig_init_user(void) {
- work_louder_config.raw = 0;
- work_louder_config.led_level = 1;
- eeconfig_update_user(work_louder_config.raw);
-}
-
-void matrix_init_user(void) {
- work_louder_config.raw = eeconfig_read_user();
- work_louder_micro_led_all_set((uint8_t)(work_louder_config.led_level * 255 / 4));
-}
diff --git a/keyboards/work_louder/micro/matrix.c b/keyboards/work_louder/micro/matrix.c
deleted file mode 100644
index d2ae16ad9c..0000000000
--- a/keyboards/work_louder/micro/matrix.c
+++ /dev/null
@@ -1,131 +0,0 @@
-// Copyright 2022 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
-// SPDX-License-Identifier: GPL-2.0-or-later
-
-/*
- * scan matrix
- */
-#include <stdint.h>
-#include <stdbool.h>
-#include <avr/io.h>
-#include "wait.h"
-#include "print.h"
-#include "debug.h"
-#include "util.h"
-#include "matrix.h"
-#include "debounce.h"
-#include QMK_KEYBOARD_H
-
-/* matrix state(1:on, 0:off) */
-extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
-extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
-
-static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
-static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
-#define MATRIX_ROW_SHIFTER ((matrix_row_t)1)
-
-static inline void setPinOutput_writeLow(pin_t pin) {
- ATOMIC_BLOCK_FORCEON {
- setPinOutput(pin);
- writePinLow(pin);
- }
-}
-
-static inline void setPinOutput_writeHigh(pin_t pin) {
- ATOMIC_BLOCK_FORCEON {
- setPinOutput(pin);
- writePinHigh(pin);
- }
-}
-
-static inline void setPinInputHigh_atomic(pin_t pin) {
- ATOMIC_BLOCK_FORCEON {
- setPinInputHigh(pin);
- }
-}
-
-static inline uint8_t readMatrixPin(pin_t pin) {
- if (pin != NO_PIN) {
- return readPin(pin);
- } else {
- return 1;
- }
-}
-
-static bool select_row(uint8_t row) {
- pin_t pin = row_pins[row];
- if (pin != NO_PIN) {
- setPinOutput_writeLow(pin);
- return true;
- }
- return false;
-}
-
-static void unselect_row(uint8_t row) {
- pin_t pin = row_pins[row];
- if (pin != NO_PIN) {
- setPinInputHigh_atomic(pin);
- }
-}
-
-static void unselect_rows(void) {
- for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
- unselect_row(x);
- }
-}
-
-__attribute__((weak)) void matrix_init_custom(void) {
- unselect_rows();
- for (uint8_t x = 0; x < MATRIX_COLS; x++) {
- if (col_pins[x] != NO_PIN) {
- setPinInputHigh_atomic(col_pins[x]);
- }
- }
- setPinInputHigh_atomic(F7);
- setPinInputHigh_atomic(F0);
-}
-
-void matrix_read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
- // Start with a clear matrix row
- matrix_row_t current_row_value = 0;
-
- if (!select_row(current_row)) { // Select row
- return; // skip NO_PIN row
- }
- matrix_output_select_delay();
-
- // For each col...
- matrix_row_t row_shifter = MATRIX_ROW_SHIFTER;
- for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++, row_shifter <<= 1) {
- uint8_t pin_state = 0;
- if (current_row == 3 && col_index == 0) {
- pin_state = !readMatrixPin(F7);
- } else if (current_row == 3 && col_index == 3) {
- pin_state = !readMatrixPin(F0);
- } else {
- pin_state = readMatrixPin(col_pins[col_index]);
- }
- // Populate the matrix row with the state of the col pin
- current_row_value |= pin_state ? 0 : row_shifter;
- }
-
- // Unselect row
- unselect_row(current_row);
- matrix_output_unselect_delay(current_row, current_row_value != 0); // wait for all Col signals to go HIGH
-
- // Update the matrix
- current_matrix[current_row] = current_row_value;
-}
-
-bool matrix_scan_custom(matrix_row_t current_matrix[]) {
- static matrix_row_t temp_matrix[MATRIX_ROWS] = {0};
-
- for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
- matrix_read_cols_on_row(temp_matrix, current_row);
- }
-
- bool changed = memcmp(current_matrix, temp_matrix, sizeof(temp_matrix)) != 0;
- if (changed) {
- memcpy(current_matrix, temp_matrix, sizeof(temp_matrix));
- }
- return changed;
-}
diff --git a/keyboards/work_louder/micro/micro.c b/keyboards/work_louder/micro/micro.c
deleted file mode 100644
index 80d3927417..0000000000
--- a/keyboards/work_louder/micro/micro.c
+++ /dev/null
@@ -1,170 +0,0 @@
-// Copyright 2022 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
-// SPDX-License-Identifier: GPL-2.0-or-later
-
-#include QMK_KEYBOARD_H
-
-#if defined(RGB_MATRIX_ENABLE)
-// clang-format off
-led_config_t g_led_config = { {
- { NO_LED, 10, 11, NO_LED },
- { 9 , 8, 7, 6 },
- { 2, 3, 4, 5 },
- { NO_LED, 1, 0, NO_LED }
- }, {
- { 122, 64 }, { 103, 64 },
- { 84, 45 }, { 103, 45 }, { 133, 45 }, { 152, 45 },
- { 152, 26 }, { 122, 26 }, { 103, 26 }, { 84, 26 },
- { 103, 7 }, { 122, 7 }
- },
- {
- 4, 4,
- 4, 4, 4, 4,
- 4, 4, 4, 4,
- 4, 4
- }
-};
-// clang-format on
-#endif
-
-#if defined(ENCODER_ENABLE)
-bool encoder_update_kb(uint8_t index, bool clockwise) {
- if (!encoder_update_user(index, clockwise)) {
- return false;
- }
- if (index == 0) {
- if (clockwise) {
- tap_code_delay(KC_VOLU, 10);
- } else {
- tap_code_delay(KC_VOLD, 10);
- }
- } else if (index == 1) {
- if (clockwise) {
- tap_code_delay(KC_WH_U, 10);
- } else {
- tap_code_delay(KC_WH_D, 10);
- }
- }
- return true;
-}
-#endif
-
-void work_louder_micro_led_1_on(void) {
- writePin(WORK_LOUDER_LED_PIN_1, true);
-}
-void work_louder_micro_led_2_on(void) {
- writePin(WORK_LOUDER_LED_PIN_2, true);
-}
-void work_louder_micro_led_3_on(void) {
- writePin(WORK_LOUDER_LED_PIN_3, true);
-}
-
-void work_louder_micro_led_1_off(void) {
- writePin(WORK_LOUDER_LED_PIN_1, false);
-}
-void work_louder_micro_led_2_off(void) {
- writePin(WORK_LOUDER_LED_PIN_2, false);
-}
-void work_louder_micro_led_3_off(void) {
- writePin(WORK_LOUDER_LED_PIN_3, false);
-}
-
-void work_louder_micro_led_all_on(void) {
- work_louder_micro_led_1_on();
- work_louder_micro_led_2_on();
- work_louder_micro_led_3_on();
-}
-
-void work_louder_micro_led_all_off(void) {
- work_louder_micro_led_1_off();
- work_louder_micro_led_2_off();
- work_louder_micro_led_3_off();
-}
-
-void work_louder_micro_led_1_set(uint8_t n) {
-#if WORK_LOUDER_LED_PIN_1 == B7
- OCR1C = n;
-#else
- n ? work_louder_micro_led_1_on() : work_louder_micro_led_1_off();
-#endif
-}
-void work_louder_micro_led_2_set(uint8_t n) {
-#if WORK_LOUDER_LED_PIN_2 == B6
- OCR1B = n;
-#else
- n ? work_louder_micro_led_2_on() : work_louder_micro_led_2_off();
-#endif
-}
-void work_louder_micro_led_3_set(uint8_t n) {
-#if WORK_LOUDER_LED_PIN_3 == B5
- OCR1A = n;
-#else
- n ? work_louder_micro_led_3_on() : work_louder_micro_led_3_off();
-#endif
-}
-
-void work_louder_micro_led_all_set(uint8_t n) {
- work_louder_micro_led_1_set(n);
- work_louder_micro_led_2_set(n);
- work_louder_micro_led_3_set(n);
-}
-
-#ifdef DEFER_EXEC_ENABLE
-uint32_t startup_animation(uint32_t trigger_time, void *cb_arg) {
- static uint8_t index = 0;
-
- switch (index) {
- case 0:
- work_louder_micro_led_1_on();
- break;
- case 1:
- work_louder_micro_led_2_on();
- break;
- case 2:
- work_louder_micro_led_3_on();
- break;
- case 3:
- work_louder_micro_led_1_off();
- break;
- case 4:
- work_louder_micro_led_2_off();
- break;
- case 5:
- work_louder_micro_led_3_off();
- break;
- default:
- return 0;
- }
- index++;
- return 100;
-}
-#endif
-
-void matrix_init_kb(void) {
-
- setPinOutput(WORK_LOUDER_LED_PIN_1); // left led
- writePin(WORK_LOUDER_LED_PIN_1, false);
- setPinOutput(WORK_LOUDER_LED_PIN_2); // middle led
- writePin(WORK_LOUDER_LED_PIN_2, false);
- setPinOutput(WORK_LOUDER_LED_PIN_3); // right led
- writePin(WORK_LOUDER_LED_PIN_3, false);
-
-#ifdef DEFER_EXEC_ENABLE
- defer_exec(500, startup_animation, NULL);
-#else
- wait_ms(500);
- work_louder_micro_led_1_on();
- wait_ms(100);
- work_louder_micro_led_2_on();
- wait_ms(100);
- work_louder_micro_led_3_on();
- wait_ms(100);
- work_louder_micro_led_1_off();
- wait_ms(100);
- work_louder_micro_led_2_off();
- wait_ms(100);
- work_louder_micro_led_3_off();
- wait_ms(200);
-#endif
- matrix_init_user();
-
-}
diff --git a/keyboards/work_louder/micro/micro.h b/keyboards/work_louder/micro/micro.h
deleted file mode 100644
index 715b09eb33..0000000000
--- a/keyboards/work_louder/micro/micro.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2022 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
-// SPDX-License-Identifier: GPL-2.0-or-later
-
-#include "quantum.h"
-
-extern void work_louder_micro_led_1_on(void);
-extern void work_louder_micro_led_2_on(void);
-extern void work_louder_micro_led_3_on(void);
-
-extern void work_louder_micro_led_1_off(void);
-extern void work_louder_micro_led_2_off(void);
-extern void work_louder_micro_led_3_off(void);
-
-extern void work_louder_micro_led_all_on(void);
-
-extern void work_louder_micro_led_all_off(void);
-
-extern void work_louder_micro_led_1_set(uint8_t n);
-extern void work_louder_micro_led_2_set(uint8_t n);
-extern void work_louder_micro_led_3_set(uint8_t n);
-
-extern void work_louder_micro_led_all_set(uint8_t n);
diff --git a/keyboards/work_louder/micro/readme.md b/keyboards/work_louder/micro/readme.md
deleted file mode 100644
index 568980e57b..0000000000
--- a/keyboards/work_louder/micro/readme.md
+++ /dev/null
@@ -1,26 +0,0 @@
-# work_louder/micro
-
-![work_louder/micro](https://i.imgur.com/4Hdt41Gh.jpg)
-
-A 16 "key" macro pad, with dual encoders, per key RGB, RGB underglow and more
-
-* Keyboard Maintainer: [Drashna Jael're](https://github.com/Drashna Jael're)
-* Hardware Supported: atmega32u4 based PCB
-* Hardware Availability: [Work Louder shop](https://worklouder.cc/creator-micro/)
-
-Make example for this keyboard (after setting up your build environment):
-
- make work_louder/micro:default
-
-Flashing example for this keyboard:
-
- make work_louder/micro: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 2 ways:
-
-* **Bootmagic reset**: Hold down the horizontal encoder (top left) and plug in the keyboard
-* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead
diff --git a/keyboards/work_louder/micro/rules.mk b/keyboards/work_louder/micro/rules.mk
deleted file mode 100644
index 757b87cfe4..0000000000
--- a/keyboards/work_louder/micro/rules.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-RGB_MATRIX_DRIVER = WS2812
-
-SRC += rgb_functions.c \
- matrix.c
-
-DEFERRED_EXEC_ENABLE = yes