diff --git a/flake.nix b/flake.nix index c92e4f0726..4bf8458105 100644 --- a/flake.nix +++ b/flake.nix @@ -5,9 +5,24 @@ flake-utils.url = github:numtide/flake-utils; }; outputs = { self, nixpkgs, flake-utils }: - flake-utils.lib.eachDefaultSystem (system: { - devShell = pkgs.mkShell { - buildInputs = [ pkgs.qmk ]; - }; - }); + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + formatter = pkgs.nixpkgs-fmt; + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ + qmk + gnumake + + gcc-arm-embedded + avrdude + dfu-programmer + dfu-util + ]; + }; + } + ); } + diff --git a/keyboards/noisy_cricket/config.h b/keyboards/noisy_cricket/config.h index bb85f0bc33..441c168d0a 100644 --- a/keyboards/noisy_cricket/config.h +++ b/keyboards/noisy_cricket/config.h @@ -1,122 +1,12 @@ -// Copyright 2023 XenGi (@xengi) -// SPDX-License-Identifier: GPL-2.0-or-later - -/* - * ┌───┬───┬───┬───┬───┬───┬───┐ - * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │Prt│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │ Tab │ Q │ W │ E │ R │Enter│ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┐ │ - * │Shift │ A │ S │ D │ F │ │ - * ├───┬──┴┬──┴┬──┴┬──┴───┴┬───┤ - * │Ctl│Fn │ C │ V │ Space │Mut│ - * └───┴───┴───┴───┴───────┴───┘ - */ - -#pragma once - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 6 - -/* Keyboard Matrix Assignments */ -//#define MATRIX_ROW_PINS { F6, D7, D3, D2 } -//#define MATRIX_COL_PINS { C7, C6, B5, B4, B6, F7 } -//#define DIODE_DIRECTION COL2ROW - -// The pin connected to the data pin of the LEDs -#define WS2812_DI_PIN D5 -#ifdef WS2812_DI_PIN -# define RGBLED_NUM 23 -# define RGBLIGHT_HUE_STEP 10 -# define RGBLIGHT_SAT_STEP 17 -# define RGBLIGHT_VAL_STEP 17 -# define RGBLIGHT_ANIMATIONS -#endif - -// The number of LEDs connected -#define RGB_MATRIX_LED_COUNT 23 -#define DRIVER_LED_TOTAL 23 - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 5 - +// optimize firmware +#undef LOCKING_SUPPORT_ENABLE +#undef LOCKING_RESYNC_ENABLE #define LAYER_STATE_8BIT -#define ENCODERS_PAD_A { D0 } -#define ENCODERS_PAD_B { D1 } -//#define ENCODER_DIRECTION_FLIP -#define ENCODER_RESOLUTION 4 - - -/* - * 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 +// disable features to save on code size #define NO_ACTION_TAPPING #define NO_ACTION_ONESHOT -#define NO_MUSIC_MODE -#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 Enables -#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 -#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL -#define ENABLE_RGB_MATRIX_DUAL_BEACON -#define ENABLE_RGB_MATRIX_RAINBOW_BEACON -#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS -#define ENABLE_RGB_MATRIX_RAINDROPS -#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -#define ENABLE_RGB_MATRIX_HUE_BREATHING -#define ENABLE_RGB_MATRIX_HUE_PENDULUM -#define ENABLE_RGB_MATRIX_HUE_WAVE -#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL -#define ENABLE_RGB_MATRIX_PIXEL_FLOW -#define ENABLE_RGB_MATRIX_PIXEL_RAIN - -#define RGB_MATRIX_FRAMEBUFFER_EFFECTS -#define ENABLE_RGB_MATRIX_TYPING_HEATMAP -#define ENABLE_RGB_MATRIX_DIGITAL_RAIN - -#define RGB_MATRIX_KEYPRESSES -#define RGB_MATRIX_KEYRELEASES -#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 - -// limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) -#define RGB_MATRIX_LED_FLUSH_LIMIT 16 -// limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 -#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 +// RGB configuration +#define RGBLIGHT_LED_COUNT 23 diff --git a/keyboards/noisy_cricket/info.json b/keyboards/noisy_cricket/info.json deleted file mode 100644 index cf09804580..0000000000 --- a/keyboards/noisy_cricket/info.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "manufacturer": "XenGi", -<<<<<<< HEAD - "keyboard_name": "Noisy Cricket", - "maintainer": "XenGi", - "bootloader": "atmel-dfu", - "diode_direction": "ROW2COL", -======= - "keyboard_name": "noisy_cricket", - "maintainer": "XenGi", - "bootloader": "atmel-dfu", - "diode_direction": "COL2ROW", ->>>>>>> f5cd3ad8684b08c2e98cbed3f8291ec55d6fcd1d - "features": { - "bootmagic": true, - "command": false, - "console": false, - "extrakey": true, - "mousekey": true, - "nkro": true - }, - "matrix_pins": { - "cols": ["C7", "C6", "B5", "B4", "B6", "F7"], - "rows": ["F6", "D7", "D3", "D2"] - }, - "processor": "atmega32u4", - "url": "https://gitlab.com/noisy_cricket", - "usb": { - "device_version": "1.0.0", - "pid": "0x1209", - "vid": "0x4237" - }, - "layouts": { - "LAYOUT": { - "layout": [ - { "matrix": [0, 0], "x": 0, "y": 0, "label": "Esc" }, - { "matrix": [0, 1], "x": 1, "y": 0, "label": "1" }, - { "matrix": [0, 2], "x": 2, "y": 0, "label": "2" }, - { "matrix": [0, 3], "x": 3, "y": 0, "label": "3" }, - { "matrix": [0, 4], "x": 4, "y": 0, "label": "4" }, - { "matrix": [0, 5], "x": 5, "y": 0, "label": "5" }, - { "matrix": [1, 0], "x": 0, "y": 1, "w": 1.5, "label": "Tab" }, - { "matrix": [1, 1], "x": 1.5, "y": 1, "label": "Q" }, - { "matrix": [1, 2], "x": 2.5, "y": 1, "label": "W" }, - { "matrix": [1, 3], "x": 3.5, "y": 1, "label": "E" }, - { "matrix": [1, 4], "x": 4.5, "y": 1, "label": "R" }, - { "matrix": [1, 5], "x": 6, "y": 0, "label": "Print" }, - { "matrix": [2, 0], "x": 0, "y": 2, "label": "Shift" }, - { "matrix": [2, 1], "x": 1.75, "y": 2, "label": "A" }, - { "matrix": [2, 2], "x": 2.75, "y": 2, "label": "S" }, - { "matrix": [2, 3], "x": 3.75, "y": 2, "label": "D" }, - { "matrix": [2, 4], "x": 4.75, "y": 2, "label": "F" }, - { "matrix": [2, 5], "x": 5.75, "y": 2, "h": 2, "label": "Enter" }, - { "matrix": [3, 0], "x": 0, "y": 3, "label": "Ctrl" }, - { "matrix": [3, 1], "x": 1, "y": 3, "label": "Fn" }, - { "matrix": [3, 2], "x": 2, "y": 3, "label": "C" }, - { "matrix": [3, 3], "x": 3, "y": 3, "label": "V" }, - { "matrix": [3, 4], "x": 4, "y": 3, "w": 2, "label": "Space" }, - { "matrix": [3, 6], "x": 6, "y": 3, "label": "Mute" } - ] - } - } -} diff --git a/keyboards/noisy_cricket/keyboard.json b/keyboards/noisy_cricket/keyboard.json index 87b0bc085d..2753e9390e 100644 --- a/keyboards/noisy_cricket/keyboard.json +++ b/keyboards/noisy_cricket/keyboard.json @@ -1,11 +1,10 @@ { - "keyboard_name": "Noisy Cricket", "manufacturer": "XenGi", - "usb": { - "vid": "0x1209", - "pid": "0x4237", - "device_version": "1.0.0" - }, + "keyboard_name": "noisy_cricket", + "maintainer": "XenGi", + "bootloader": "atmel-dfu", + "diode_direction": "ROW2COL", + "debounce": 5, "features": { "bootmagic": true, "command": false, @@ -13,23 +12,47 @@ "extrakey": true, "mousekey": true, "nkro": true, - "key_lock": true, - "rgb_matrix": true + "rgb_matrix": true, + "rgblight": false + }, + "bootmagic": { + "enabled": true, + "matrix": [0, 0] + }, + "encoder": { + "rotary": [ + { + "pin_a": "D0", + "pin_b": "D1", + "resolution": 4 + } + ] }, - "processor": "atmega32u4", - "bootloader": "atmel-dfu", - "debounce": 2, "matrix_pins": { "cols": ["C7", "C6", "B5", "B4", "B6", "F7"], "rows": ["F6", "D7", "D3", "D2"] }, - "diode_direction": "ROW2COL", + "processor": "atmega32u4", + "url": "https://gitlab.com/noisy_cricket", + "bootloader_instructions": "Press the button marked RESET on the back of the PCB", + "tags": ["rgb", "gaming", "mini", "hotswap", "knob"], + "usb": { + "device_version": "1.0.0", + "pid": "0x4237", + "vid": "0x1209" + }, + "build": { + "lto": true + }, "rgb_matrix": { - "driver": "ws2812", "center_point": [80, 30], - "max_brightness": 128, - "val_steps": 26, - "speed_steps": 52, + "default": { + "hue": 10, + "sat": 17, + "val": 17 + }, + "driver": "ws2812", + "max_brightness": 200, "animations": { "gradient_up_down": true, "gradient_left_right": true, @@ -78,28 +101,29 @@ { "matrix": [0, 3], "x": 3, "y": 0, "flags": 4 }, { "matrix": [0, 4], "x": 4, "y": 0, "flags": 4 }, { "matrix": [0, 5], "x": 5, "y": 0, "flags": 4 }, - { "matrix": [1, 0], "x": 0, "y": 1, "w": 1.5, "flags": 4 }, - { "matrix": [1, 1], "x": 1.5, "y": 1, "flags": 4 }, - { "matrix": [1, 2], "x": 2.5, "y": 1, "flags": 4 }, - { "matrix": [1, 3], "x": 3.5, "y": 1, "flags": 4 }, - { "matrix": [1, 4], "x": 4.5, "y": 1, "flags": 4 }, + { "matrix": [1, 0], "x": 0, "y": 1, "flags": 4 }, + { "matrix": [1, 1], "x": 1, "y": 1, "flags": 4 }, + { "matrix": [1, 2], "x": 2, "y": 1, "flags": 4 }, + { "matrix": [1, 3], "x": 3, "y": 1, "flags": 4 }, + { "matrix": [1, 4], "x": 4, "y": 1, "flags": 4 }, { "matrix": [1, 5], "x": 6, "y": 0, "flags": 4 }, { "matrix": [2, 0], "x": 0, "y": 2, "flags": 4 }, - { "matrix": [2, 1], "x": 1.75, "y": 2, "flags": 4 }, - { "matrix": [2, 2], "x": 2.75, "y": 2, "flags": 4 }, - { "matrix": [2, 3], "x": 3.75, "y": 2, "flags": 4 }, - { "matrix": [2, 4], "x": 4.75, "y": 2, "flags": 4 }, - { "matrix": [2, 5], "x": 5.75, "y": 2, "h": 2, "flags": 4 }, + { "matrix": [2, 1], "x": 1, "y": 2, "flags": 4 }, + { "matrix": [2, 2], "x": 2, "y": 2, "flags": 4 }, + { "matrix": [2, 3], "x": 3, "y": 2, "flags": 4 }, + { "matrix": [2, 4], "x": 4, "y": 2, "flags": 4 }, + { "matrix": [2, 5], "x": 5, "y": 2, "flags": 4 }, { "matrix": [3, 0], "x": 0, "y": 3, "flags": 4 }, { "matrix": [3, 1], "x": 1, "y": 3, "flags": 4 }, { "matrix": [3, 2], "x": 2, "y": 3, "flags": 4 }, { "matrix": [3, 3], "x": 3, "y": 3, "flags": 4 }, - { "matrix": [3, 4], "x": 4, "y": 3, "w": 2, "flags": 4 }, - { "matrix": [3, 6], "x": 6, "y": 3, "flags": 4 } + { "matrix": [3, 4], "x": 4, "y": 3, "flags": 4 }, + { "matrix": [3, 5], "x": 5, "y": 3, "flags": 4 } ] }, "ws2812": { - "pin": "D5" + "pin": "D5", + "rgbw": true }, "layouts": { "LAYOUT": { @@ -127,9 +151,8 @@ { "matrix": [3, 2], "x": 2, "y": 3, "label": "C" }, { "matrix": [3, 3], "x": 3, "y": 3, "label": "V" }, { "matrix": [3, 4], "x": 4, "y": 3, "w": 2, "label": "Space" }, - { "matrix": [3, 6], "x": 6, "y": 3, "label": "Mute" } + { "matrix": [3, 5], "x": 5, "y": 3, "label": "Mute", "encoder": 0 } ] } } } - diff --git a/keyboards/noisy_cricket/keymaps/default/keymap.c b/keyboards/noisy_cricket/keymaps/default/keymap.c index ddfd42df32..cea448dfd6 100644 --- a/keyboards/noisy_cricket/keymaps/default/keymap.c +++ b/keyboards/noisy_cricket/keymaps/default/keymap.c @@ -1,7 +1,33 @@ -// Copyright 2023 QMK +// Copyright 2023 XenGi // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H +#include "quantum.h" + +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, \ + k10, k11, k12, k13, k14, k15, \ + k20, k21, k22, k23, k24, \ + k30, k31, k32, k33, k34, k35 \ +) { \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k06 }, \ + { k20, k21, k22, k23, k24, k15 }, \ + { k30, k31, k32, k33, k34, k35 } \ +} + + +#ifndef MAGIC_ENABLE +uint16_t keycode_config(uint16_t keycode) { + return keycode; +} +#endif + +#ifndef MAGIC_ENABLE +uint8_t mod_config(uint8_t mod) { + return mod; +} +#endif const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* diff --git a/keyboards/noisy_cricket/noisy_cricket.c b/keyboards/noisy_cricket/noisy_cricket.c index 6169e96fb0..9f21975f73 100644 --- a/keyboards/noisy_cricket/noisy_cricket.c +++ b/keyboards/noisy_cricket/noisy_cricket.c @@ -16,9 +16,9 @@ led_config_t g_led_config = { }; bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; /* Don't process further events if user function exists and returns false */ - } + //if (!encoder_update_user(index, clockwise)) { + // return false; /* Don't process further events if user function exists and returns false */ + //} if (index == 0) { /* First encoder */ if (clockwise) { tap_code_delay(KC_VOLU, 10); diff --git a/keyboards/noisy_cricket/noisy_cricket.h b/keyboards/noisy_cricket/noisy_cricket.h index 56ce04c334..e69de29bb2 100644 --- a/keyboards/noisy_cricket/noisy_cricket.h +++ b/keyboards/noisy_cricket/noisy_cricket.h @@ -1,16 +0,0 @@ -#pragma once - -#include "quantum.h" - -#define LAYOUT( \ - k00, k01, k02, k03, k04, k05, k06, \ - k10, k11, k12, k13, k14, k15, \ - k20, k21, k22, k23, k24, \ - k30, k31, k32, k33, k34, k35 \ -) { \ - { k00, k01, k02, k03, k04, k05 }, \ - { k10, k11, k12, k13, k14, k06 }, \ - { k20, k21, k22, k23, k24, k15 }, \ - { k30, k31, k32, k33, k34, k35 } \ -} - diff --git a/keyboards/noisy_cricket/readme.md b/keyboards/noisy_cricket/readme.md index 4a90e91c93..2152533404 100644 --- a/keyboards/noisy_cricket/readme.md +++ b/keyboards/noisy_cricket/readme.md @@ -1,24 +1,14 @@ # noisy cricket (mini gaming keyboard) -<<<<<<< HEAD ![front](https://imgur.com/sgD8X4e.png) -======= -![front](https://imgur.com/sgD8X4e.png) ->>>>>>> f5cd3ad8684b08c2e98cbed3f8291ec55d6fcd1d ![back](https://imgur.com/6gjiKvC.png) A QMK based mini gaming keyboard intended gaming on the go. -<<<<<<< HEAD * Keyboard Maintainer: [XenGi](https://gitlab.com/XenGi) * Hardware Supported: [PCB](https://gitlab.com/noisy_cricket/pcb) * Hardware Availability: [gerber files](https://gitlab.com/noisy_cricket/pcb/-/releases/rev2) * USB ID: [1209:4237](https://pid.codes/1209/4237/) -======= -* Keyboard Maintainer: [XenGi](https://github.com/XenGi) -* Hardware Supported: [t9](https://github.com/noisy_cricket/pcb) -* Hardware Availability: [gerber files](https://gitlab.com/noisy_cricket/pcb/-/releases/rev1) ->>>>>>> f5cd3ad8684b08c2e98cbed3f8291ec55d6fcd1d Make example for this keyboard (after setting up your build environment): @@ -44,6 +34,8 @@ make noisy_cricket:default:flash qmk flash -kb noisy_cricket -km default ``` +Their is also a `via` layout. if you want to use [VIA](https://www.caniusevia.com/). + 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 @@ -51,9 +43,6 @@ See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_to 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 -<<<<<<< HEAD * **Physical reset button**: Briefly press the reset button on the back of the PCB -======= -* **Physical reset button**: Briefly short the pads on the back of the PCB ->>>>>>> f5cd3ad8684b08c2e98cbed3f8291ec55d6fcd1d +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available diff --git a/keyboards/noisy_cricket/rules.mk b/keyboards/noisy_cricket/rules.mk index c999bd1520..683996821f 100644 --- a/keyboards/noisy_cricket/rules.mk +++ b/keyboards/noisy_cricket/rules.mk @@ -1,3 +1,7 @@ +# build options +#LAYOUTS = [] + +# AVR MCU Options MCU = atmega32u4 F_CPU = 16000000 ARCH = AVR8 @@ -5,32 +9,18 @@ F_USB = $(F_CPU) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT 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 = 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 +# Feature Options +MAGIC_ENABLE = no +COMBO_ENABLE = no +AUDIO_ENABLE = no +KEY_OVERRIDE_ENABLE = no +LEADER_ENABLE = no +MIDI_ENABLE = no +UNICODE_ENABLE = no +BLUETOOTH_ENABLE = no +SPLIT_KEYBOARD = no +MUSIC_ENABLE = no SPACE_CADET_ENABLE = no GRAVE_ESC_ENABLE = no -MAGIC_ENABLE = no -MUSIC_ENABLE = no - -RGB_MATRIX_ENABLE = yes -<<<<<<< HEAD -RGB_MATRIX_DRIVER = ws2812 # also supports SK6812MINI -======= -RGB_MATRIX_DRIVER = WS2812 # also supports SK6812MINI ->>>>>>> f5cd3ad8684b08c2e98cbed3f8291ec55d6fcd1d -TAP_DANCE_ENABLE = no - -WS2812_DRIVER = bitbang - +AVR_USE_MINIMAL_PRINTF = yes ENCODER_ENABLE = yes -