├── lib ├── python │ └── qmk │ │ ├── __init__.py │ │ ├── tests │ │ ├── __init__.py │ │ ├── .gitignore │ │ ├── onekey_export.json │ │ ├── test_qmk_errors.py │ │ ├── attrdict.py │ │ ├── test_qmk_path.py │ │ └── kle.txt │ │ ├── cli │ │ ├── new │ │ │ └── __init__.py │ │ ├── chibios │ │ │ └── __init__.py │ │ ├── list │ │ │ ├── __init__.py │ │ │ ├── keyboards.py │ │ │ └── keymaps.py │ │ ├── generate │ │ │ ├── __init__.py │ │ │ └── docs.py │ │ ├── json │ │ │ ├── __init__.py │ │ │ └── keymap.py │ │ ├── hello.py │ │ ├── fileformat.py │ │ ├── pytest.py │ │ ├── clean.py │ │ ├── pyformat.py │ │ ├── __init__.py │ │ └── docs.py │ │ ├── errors.py │ │ ├── comment_remover.py │ │ ├── converter.py │ │ ├── datetime.py │ │ ├── math.py │ │ └── constants.py └── lib8tion │ └── LICENSE ├── quantum ├── serial_link │ ├── README.md │ ├── tests │ │ ├── testlist.mk │ │ └── rules.mk │ └── LICENSE ├── sequencer │ └── tests │ │ ├── testlist.mk │ │ ├── rules.mk │ │ ├── midi_mock.h │ │ └── midi_mock.c ├── template │ ├── base │ │ ├── keymaps │ │ │ └── default │ │ │ │ └── readme.md │ │ ├── info.json │ │ └── keyboard.c │ ├── ps2avrgb │ │ ├── rules.mk │ │ ├── i2c.h │ │ └── readme.md │ └── avr │ │ ├── readme.md │ │ └── rules.mk ├── split_common │ ├── eeprom-lefthand.eep │ ├── eeprom-righthand.eep │ ├── split_util.h │ ├── transport.h │ └── post_config.h ├── audio │ ├── muse.h │ └── luts.h ├── visualizer │ ├── resources │ │ ├── lcd_logo.png │ │ └── resources.h │ ├── visualizer_keyframes.c │ └── visualizer_keyframes.h ├── backlight │ └── backlight_driver_common.h ├── rgblight_post_config.h ├── process_keycode │ ├── process_joystick.h │ ├── process_audio.h │ ├── process_clicky.h │ ├── process_magic.h │ ├── process_grave_esc.h │ ├── process_rgb.h │ ├── process_backlight.h │ ├── process_terminal_nop.h │ ├── process_key_lock.h │ ├── process_sequencer.h │ ├── process_unicode.h │ ├── process_printer.h │ ├── process_space_cadet.h │ ├── process_unicodemap.h │ ├── process_terminal.h │ ├── process_steno.h │ └── process_unicode.c ├── tools │ ├── readme.md │ └── eeprom_reset.hex ├── velocikey.h ├── debounce.h ├── rgb_matrix_animations │ ├── cycle_all_anim.h │ ├── cycle_up_down_anim.h │ ├── cycle_out_in_anim.h │ ├── cycle_pinwheel_anim.h │ ├── solid_color_anim.h │ ├── cycle_left_right_anim.h │ ├── cycle_spiral_anim.h │ ├── colorband_sat_anim.h │ ├── colorband_val_anim.h │ ├── colorband_pinwheel_sat_anim.h │ ├── colorband_pinwheel_val_anim.h │ ├── colorband_spiral_sat_anim.h │ ├── colorband_spiral_val_anim.h │ ├── dual_beacon_anim.h │ ├── solid_reactive_anim.h │ ├── rainbow_moving_chevron_anim.h │ ├── rainbow_beacon_anim.h │ ├── cycle_out_in_dual_anim.h │ ├── solid_reactive_simple_anim.h │ ├── rainbow_pinwheels_anim.h │ ├── breathing_anim.h │ ├── gradient_up_down_anim.h │ ├── alpha_mods_anim.h │ └── gradient_left_right_anim.h ├── joystick.c ├── rgb_matrix_runners │ ├── effect_runner_i.h │ ├── effect_runner_sin_cos_i.h │ ├── effect_runner_dx_dy.h │ ├── effect_runner_dx_dy_dist.h │ └── effect_runner_reactive.h ├── led_tables.h ├── api │ └── api_sysex.h ├── wpm.h ├── pointing_device.h ├── encoder.h └── dip_switch.h ├── keyboards ├── ergodox_ez │ ├── shine │ │ ├── rules.mk │ │ ├── shine.h │ │ └── config.h │ ├── keymaps │ │ ├── oryx │ │ │ ├── rules.mk │ │ │ └── config.h │ │ ├── webusb │ │ │ ├── rules.mk │ │ │ ├── default.png.md │ │ │ ├── default_highres.png.md │ │ │ └── readme.md │ │ └── default │ │ │ ├── default.png.md │ │ │ ├── default_highres.png.md │ │ │ └── readme.md │ ├── glow │ │ ├── keymaps │ │ │ ├── glow │ │ │ │ ├── keymap.c │ │ │ │ └── rules.mk │ │ │ └── reactive │ │ │ │ ├── keymap.c │ │ │ │ ├── rules.mk │ │ │ │ └── config.h │ │ ├── rules.mk │ │ ├── glow.h │ │ └── config.h │ ├── util │ │ └── readme.md │ └── 190hotfix.sh ├── moonlander │ ├── keymaps │ │ ├── oryx │ │ │ ├── keymap.c │ │ │ ├── config.h │ │ │ └── rules.mk │ │ ├── webusb │ │ │ ├── keymap.c │ │ │ ├── config.h │ │ │ └── rules.mk │ │ └── default │ │ │ └── config.h │ └── rules.mk └── planck │ ├── ez │ ├── glow │ │ ├── rules.mk │ │ ├── keymaps │ │ │ └── glow │ │ │ │ ├── rules.mk │ │ │ │ ├── readme.md │ │ │ │ └── config.h │ │ ├── glow.h │ │ └── config.h │ └── rules.mk │ ├── keymaps │ ├── webusb │ │ ├── readme.md │ │ ├── rules.mk │ │ └── config.h │ ├── default │ │ ├── readme.md │ │ ├── rules.mk │ │ └── config.h │ └── oryx │ │ ├── rules.mk │ │ └── config.h │ ├── planck.h │ ├── readme.md │ └── planck.c ├── nose2.cfg ├── tmk_core ├── common │ ├── magic.h │ ├── raw_hid.h │ ├── arm_atsam │ │ ├── printf.h │ │ └── timer.c │ ├── uart.h │ ├── virtser.h │ ├── sleep_led.h │ ├── suspend.h │ ├── progmem.h │ ├── debug.c │ ├── test │ │ ├── suspend.c │ │ └── bootloader.c │ ├── sendchar_null.c │ ├── bootloader.h │ ├── sendchar_uart.c │ ├── nodebug.h │ ├── avr │ │ ├── suspend_avr.h │ │ └── bootloader_size.c │ ├── eeprom.h │ ├── sendchar.h │ ├── magic.c │ ├── host_driver.h │ ├── webusb.h │ └── chibios │ │ └── chibios_config.h ├── protocol │ ├── usb_hid │ │ ├── USB_Host_Shield_2.0 │ │ │ ├── .gitignore │ │ │ ├── .gitattributes │ │ │ ├── .gitmodules │ │ │ ├── library.properties │ │ │ ├── examples │ │ │ │ ├── max_LCD │ │ │ │ │ └── max_LCD.ino │ │ │ │ └── HID │ │ │ │ │ ├── USBHIDJoystick │ │ │ │ │ ├── hidjoystickrptparser.h │ │ │ │ │ └── USBHIDJoystick.ino │ │ │ │ │ └── le3dp │ │ │ │ │ └── le3dp_rptparser.h │ │ │ └── WiiCameraReadme.md │ │ ├── arduino-1.0.1 │ │ │ ├── cores │ │ │ │ └── arduino │ │ │ │ │ ├── Server.h │ │ │ │ │ ├── main.cpp │ │ │ │ │ ├── new.cpp │ │ │ │ │ ├── Platform.h │ │ │ │ │ ├── new.h │ │ │ │ │ └── Client.h │ │ │ └── variants │ │ │ │ └── eightanaloginputs │ │ │ │ └── pins_arduino.h │ │ ├── usb_hid.h │ │ ├── parser.h │ │ ├── parser.cpp │ │ ├── override_wiring.c │ │ ├── override_Serial.cpp │ │ └── test │ │ │ └── config.h │ ├── arm_atsam │ │ ├── wait_api.h │ │ ├── usb │ │ │ ├── usb_util.h │ │ │ └── udi_device_epsize.h │ │ ├── md_bootloader.h │ │ └── main_arm_atsam.h │ ├── chibios │ │ └── init_hooks.h │ ├── ps2_io.h │ ├── midi.mk │ ├── midi │ │ └── qmk_midi.h │ ├── vusb.mk │ ├── chibios.mk │ ├── serial_mouse.h │ ├── arm_atsam.mk │ └── usb_descriptor_common.h ├── make_dfu_header.sh └── native.mk ├── secrets.tar.enc ├── requirements.txt ├── Dockerfile ├── requirements-dev.txt ├── .github └── ISSUE_TEMPLATE │ ├── blank.md │ ├── other_issues.md │ ├── feature_request.md │ └── bug_report.md ├── drivers ├── ugfx │ └── gdisp │ │ ├── st7565 │ │ ├── driver.mk │ │ ├── gdisp_lld_config.h │ │ └── st7565.h │ │ └── is31fl3731c │ │ └── driver.mk ├── qwiic │ ├── qwiic.mk │ ├── qwiic.h │ └── qwiic.c ├── avr │ └── ws2812_i2c.c ├── eeprom │ ├── eeprom_driver.h │ └── eeprom_transient.h └── issi │ └── is31fl3218.h ├── platforms └── chibios │ ├── IC_TEENSY_3_1 │ └── board │ │ └── board.mk │ ├── GENERIC_STM32_F042X6 │ ├── board │ │ └── board.mk │ └── configs │ │ ├── bootloader_defs.h │ │ └── config.h │ ├── STM32_F103_STM32DUINO │ └── board │ │ └── board.mk │ ├── GENERIC_STM32_F303XC │ ├── configs │ │ ├── bootloader_defs.h │ │ ├── proton_c.mk │ │ └── config.h │ └── board │ │ └── board.mk │ ├── BLACKPILL_STM32_F411 │ ├── board │ │ └── board.mk │ └── configs │ │ ├── board.h │ │ └── config.h │ ├── GENERIC_STM32_F072XB │ ├── board │ │ └── board.mk │ └── configs │ │ ├── bootloader_defs.h │ │ ├── board.h │ │ └── config.h │ ├── BLACKPILL_STM32_F401 │ ├── board │ │ └── board.mk │ └── configs │ │ ├── board.h │ │ └── config.h │ └── keyboard-config-templates │ ├── board.h │ ├── halconf.h │ ├── chconf.h │ └── mcuconf.h ├── util ├── list_keyboards.sh ├── vagrant │ └── readme.md ├── usb_detach │ ├── Makefile │ └── readme.md ├── install │ ├── linux_shared.sh │ ├── void.sh │ ├── freebsd.sh │ ├── solus.sh │ ├── fedora.sh │ ├── sabayon.sh │ ├── slackware.sh │ ├── debian.sh │ ├── arch.sh │ ├── macos.sh │ ├── opensuse.sh │ └── msys2.sh ├── travis_test.sh ├── generate_internal_docs.sh ├── travis_build.sh ├── macos_install.sh └── drivers.txt ├── testlist.mk ├── common.mk ├── doxygen-todo ├── .gitmodules ├── tests ├── basic │ ├── rules.mk │ └── config.h └── test_common │ ├── test_common.hpp │ ├── test_matrix.h │ └── test_fixture.hpp ├── .clang-format └── .editorconfig /lib/python/qmk/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/python/qmk/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /quantum/serial_link/README.md: -------------------------------------------------------------------------------- 1 | # qmk_serial_link 2 | -------------------------------------------------------------------------------- /keyboards/ergodox_ez/shine/rules.mk: -------------------------------------------------------------------------------- 1 | RGBLIGHT_ENABLE = yes 2 | -------------------------------------------------------------------------------- /keyboards/moonlander/keymaps/oryx/keymap.c: -------------------------------------------------------------------------------- 1 | // placeholder 2 | -------------------------------------------------------------------------------- /keyboards/moonlander/keymaps/webusb/keymap.c: -------------------------------------------------------------------------------- 1 | // placeholder 2 | -------------------------------------------------------------------------------- /keyboards/planck/ez/glow/rules.mk: -------------------------------------------------------------------------------- 1 | RGB_MATRIX_ENABLE = yes 2 | -------------------------------------------------------------------------------- /lib/python/qmk/cli/new/__init__.py: -------------------------------------------------------------------------------- 1 | from . import keymap 2 | -------------------------------------------------------------------------------- /nose2.cfg: -------------------------------------------------------------------------------- 1 | [unittest] 2 | start-dir = lib/python/qmk/tests 3 | -------------------------------------------------------------------------------- /quantum/sequencer/tests/testlist.mk: -------------------------------------------------------------------------------- 1 | TEST_LIST += sequencer 2 | -------------------------------------------------------------------------------- /keyboards/ergodox_ez/keymaps/oryx/rules.mk: -------------------------------------------------------------------------------- 1 | ORYX_ENABLE = yes 2 | -------------------------------------------------------------------------------- /keyboards/ergodox_ez/keymaps/webusb/rules.mk: -------------------------------------------------------------------------------- 1 | WEBUSB_ENABLE = yes 2 | -------------------------------------------------------------------------------- /keyboards/planck/ez/glow/keymaps/glow/rules.mk: -------------------------------------------------------------------------------- 1 | SRC += muse.c 2 | -------------------------------------------------------------------------------- /lib/python/qmk/cli/chibios/__init__.py: -------------------------------------------------------------------------------- 1 | from . import confmigrate 2 | -------------------------------------------------------------------------------- /tmk_core/common/magic.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void magic(void); 4 | -------------------------------------------------------------------------------- /keyboards/planck/ez/glow/glow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ez.h" 4 | -------------------------------------------------------------------------------- /keyboards/planck/keymaps/webusb/readme.md: -------------------------------------------------------------------------------- 1 | # The Default Planck Layout 2 | 3 | -------------------------------------------------------------------------------- /keyboards/planck/keymaps/default/readme.md: -------------------------------------------------------------------------------- 1 | # The Default Planck Layout 2 | 3 | -------------------------------------------------------------------------------- /quantum/template/base/keymaps/default/readme.md: -------------------------------------------------------------------------------- 1 | # The default keymap for %KEYBOARD% -------------------------------------------------------------------------------- /keyboards/ergodox_ez/keymaps/default/default.png.md: -------------------------------------------------------------------------------- 1 | https://i.imgur.com/fKX0Zbs.png 2 | -------------------------------------------------------------------------------- /keyboards/ergodox_ez/keymaps/webusb/default.png.md: -------------------------------------------------------------------------------- 1 | https://i.imgur.com/fKX0Zbs.png 2 | -------------------------------------------------------------------------------- /keyboards/planck/ez/glow/keymaps/glow/readme.md: -------------------------------------------------------------------------------- 1 | # The Default Planck Layout 2 | 3 | -------------------------------------------------------------------------------- /keyboards/planck/keymaps/default/rules.mk: -------------------------------------------------------------------------------- 1 | SRC += muse.c 2 | RGB_MATRIX_ENABLE = no 3 | -------------------------------------------------------------------------------- /keyboards/ergodox_ez/keymaps/oryx/config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define LAYER_STATE_8BIT 4 | -------------------------------------------------------------------------------- /lib/python/qmk/cli/list/__init__.py: -------------------------------------------------------------------------------- 1 | from . import keyboards 2 | from . import keymaps 3 | -------------------------------------------------------------------------------- /lib/python/qmk/tests/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore generated info.json from pytest 2 | info.json 3 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/.gitignore: -------------------------------------------------------------------------------- 1 | *.bak 2 | *.zip 3 | *.rar 4 | build/ -------------------------------------------------------------------------------- /keyboards/ergodox_ez/keymaps/default/default_highres.png.md: -------------------------------------------------------------------------------- 1 | https://i.imgur.com/giAc3M9.jpg 2 | -------------------------------------------------------------------------------- /keyboards/ergodox_ez/keymaps/webusb/default_highres.png.md: -------------------------------------------------------------------------------- 1 | https://i.imgur.com/giAc3M9.jpg 2 | -------------------------------------------------------------------------------- /keyboards/moonlander/keymaps/default/config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define ORYX_CONFIGURATOR 4 | -------------------------------------------------------------------------------- /secrets.tar.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zacharyvoase/qmk_firmware/firmware20/secrets.tar.enc -------------------------------------------------------------------------------- /keyboards/moonlander/keymaps/oryx/config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../default/config.h" 4 | -------------------------------------------------------------------------------- /keyboards/moonlander/keymaps/webusb/config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../default/config.h" 4 | -------------------------------------------------------------------------------- /quantum/split_common/eeprom-lefthand.eep: -------------------------------------------------------------------------------- 1 | :0F000000000000000000000000000000000001F0 2 | :00000001FF 3 | -------------------------------------------------------------------------------- /quantum/split_common/eeprom-righthand.eep: -------------------------------------------------------------------------------- 1 | :0F000000000000000000000000000000000000F1 2 | :00000001FF 3 | -------------------------------------------------------------------------------- /keyboards/ergodox_ez/glow/keymaps/glow/keymap.c: -------------------------------------------------------------------------------- 1 | // Placeholder. See ../default/keymap.c for details 2 | -------------------------------------------------------------------------------- /keyboards/ergodox_ez/glow/keymaps/reactive/keymap.c: -------------------------------------------------------------------------------- 1 | // Placeholder. See ../default/keymap.c for details 2 | -------------------------------------------------------------------------------- /keyboards/planck/keymaps/webusb/rules.mk: -------------------------------------------------------------------------------- 1 | SRC += muse.c 2 | RGB_MATRIX_ENABLE = no 3 | WEBUSB_ENABLE = yes 4 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # Python requirements 2 | appdirs 3 | argcomplete 4 | colorama 5 | hjson 6 | milc 7 | pygments 8 | -------------------------------------------------------------------------------- /lib/python/qmk/cli/generate/__init__.py: -------------------------------------------------------------------------------- 1 | from . import api 2 | from . import docs 3 | from . import rgb_breathe_table 4 | -------------------------------------------------------------------------------- /keyboards/ergodox_ez/glow/rules.mk: -------------------------------------------------------------------------------- 1 | RGB_MATRIX_ENABLE = IS31FL3731 2 | RGB_MATRIX_ENABLE = yes 3 | RGB_MATRIX_DRIVER = IS31FL3731 4 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM qmkfm/base_container 2 | 3 | VOLUME /qmk_firmware 4 | WORKDIR /qmk_firmware 5 | COPY . . 6 | 7 | CMD make all:all 8 | -------------------------------------------------------------------------------- /keyboards/moonlander/keymaps/webusb/rules.mk: -------------------------------------------------------------------------------- 1 | SRC += ../default/keymap.c 2 | -include ../default/rules.mk 3 | 4 | WEBUSB_ENABLE = yes 5 | -------------------------------------------------------------------------------- /quantum/audio/muse.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "quantum.h" 4 | #include "process_audio.h" 5 | 6 | uint8_t muse_clock_pulse(void); 7 | -------------------------------------------------------------------------------- /quantum/visualizer/resources/lcd_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zacharyvoase/qmk_firmware/firmware20/quantum/visualizer/resources/lcd_logo.png -------------------------------------------------------------------------------- /tmk_core/common/raw_hid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void raw_hid_receive(uint8_t *data, uint8_t length); 4 | 5 | void raw_hid_send(uint8_t *data, uint8_t length); 6 | -------------------------------------------------------------------------------- /requirements-dev.txt: -------------------------------------------------------------------------------- 1 | # Install the necessary requirements 2 | -r requirements.txt 3 | 4 | # Python development requirements 5 | nose2 6 | flake8 7 | pep8-naming 8 | yapf 9 | -------------------------------------------------------------------------------- /tmk_core/protocol/arm_atsam/wait_api.h: -------------------------------------------------------------------------------- 1 | #ifndef _wait_api_h_ 2 | #define _wait_api_h_ 3 | 4 | void wait_ms(uint64_t msec); 5 | void wait_us(uint16_t usec); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/blank.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Blank issue 3 | about: If you're 100% sure that you don't need one of the other issue templates, use this one instead. 4 | 5 | --- 6 | -------------------------------------------------------------------------------- /drivers/ugfx/gdisp/st7565/driver.mk: -------------------------------------------------------------------------------- 1 | GFXINC += drivers/ugfx/gdisp/st7565 2 | GFXSRC += drivers/ugfx/gdisp/st7565/gdisp_lld_ST7565.c 3 | GDISP_DRIVER_LIST += GDISPVMT_ST7565_QMK 4 | -------------------------------------------------------------------------------- /tmk_core/common/arm_atsam/printf.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define CONSOLE_PRINTBUF_SIZE 512 4 | 5 | void console_printf(char *fmt, ...); 6 | 7 | #define __xprintf console_printf 8 | -------------------------------------------------------------------------------- /lib/python/qmk/tests/onekey_export.json: -------------------------------------------------------------------------------- 1 | { 2 | "keyboard":"handwired/onekey/pytest", 3 | "keymap":"pytest_unittest", 4 | "layout":"LAYOUT", 5 | "layers":[["KC_A"]] 6 | } 7 | -------------------------------------------------------------------------------- /keyboards/ergodox_ez/glow/keymaps/glow/rules.mk: -------------------------------------------------------------------------------- 1 | RGBLIGHT_ENABLE = no 2 | RGB_MATRIX_ENABLE = IS31FL3731 # enable later 3 | 4 | SRC += keymaps/default/keymap.c 5 | 6 | LTO_ENABLE = yes 7 | -------------------------------------------------------------------------------- /keyboards/moonlander/keymaps/oryx/rules.mk: -------------------------------------------------------------------------------- 1 | SRC += ../default/keymap.c 2 | -include ../default/rules.mk 3 | 4 | WEBUSB_ENABLE = yes 5 | ORYX_ENABLE = yes 6 | DYNAMIC_KEYMAP_ENABLE = yes 7 | -------------------------------------------------------------------------------- /drivers/ugfx/gdisp/is31fl3731c/driver.mk: -------------------------------------------------------------------------------- 1 | GFXINC += drivers/ugfx/gdisp/is31fl3731c 2 | GFXSRC += drivers/ugfx/gdisp/is31fl3731c/gdisp_is31fl3731c.c 3 | GDISP_DRIVER_LIST += GDISPVMT_IS31FL3731C_QMK 4 | -------------------------------------------------------------------------------- /quantum/backlight/backlight_driver_common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void backlight_pins_init(void); 4 | void backlight_pins_on(void); 5 | void backlight_pins_off(void); 6 | 7 | void breathing_task(void); 8 | -------------------------------------------------------------------------------- /keyboards/ergodox_ez/glow/keymaps/reactive/rules.mk: -------------------------------------------------------------------------------- 1 | RGBLIGHT_ENABLE = no 2 | RGB_MATRIX_ENABLE = IS31FL3731 # enable later 3 | 4 | SRC += keymaps/default/keymap.c 5 | 6 | LTO_ENABLE = yes 7 | COMMAND_ENABLE = no 8 | -------------------------------------------------------------------------------- /lib/python/qmk/errors.py: -------------------------------------------------------------------------------- 1 | class NoSuchKeyboardError(Exception): 2 | """Raised when we can't find a keyboard/keymap directory. 3 | """ 4 | def __init__(self, message): 5 | self.message = message 6 | -------------------------------------------------------------------------------- /tmk_core/common/uart.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | void uart_init(uint32_t baud); 6 | void uart_putchar(uint8_t c); 7 | uint8_t uart_getchar(void); 8 | uint8_t uart_available(void); 9 | -------------------------------------------------------------------------------- /quantum/serial_link/tests/testlist.mk: -------------------------------------------------------------------------------- 1 | TEST_LIST +=\ 2 | serial_link_byte_stuffer\ 3 | serial_link_frame_validator\ 4 | serial_link_frame_router\ 5 | serial_link_triple_buffered_object\ 6 | serial_link_transport 7 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/arduino-1.0.1/cores/arduino/Server.h: -------------------------------------------------------------------------------- 1 | #ifndef server_h 2 | #define server_h 3 | 4 | class Server : public Print { 5 | public: 6 | virtual void begin() =0; 7 | }; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /lib/python/qmk/cli/json/__init__.py: -------------------------------------------------------------------------------- 1 | """QMK CLI JSON Subcommands 2 | 3 | We list each subcommand here explicitly because all the reliable ways of searching for modules are slow and delay startup. 4 | """ 5 | from . import keymap 6 | -------------------------------------------------------------------------------- /quantum/rgblight_post_config.h: -------------------------------------------------------------------------------- 1 | #if defined(RGBLED_SPLIT) && !defined(RGBLIGHT_SPLIT) 2 | // When RGBLED_SPLIT is defined, 3 | // it is considered that RGBLIGHT_SPLIT is defined implicitly. 4 | # define RGBLIGHT_SPLIT 5 | #endif 6 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/usb_hid.h: -------------------------------------------------------------------------------- 1 | #ifndef USB_HID_H 2 | #define USB_HID_H 3 | 4 | #include "report.h" 5 | 6 | 7 | extern report_keyboard_t usb_hid_keyboard_report; 8 | extern uint16_t usb_hid_time_stamp; 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /tmk_core/protocol/chibios/init_hooks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Override the initialisation functions inside the ChibiOS board.c files 4 | #define __early_init __chibios_override___early_init 5 | #define boardInit __chibios_override_boardInit 6 | -------------------------------------------------------------------------------- /keyboards/planck/keymaps/oryx/rules.mk: -------------------------------------------------------------------------------- 1 | SRC += muse.c 2 | # Set any rules.mk overrides for your specific keymap here. 3 | # See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file 4 | COMMAND_ENABLE = no 5 | MOUSEKEY_ENABLE = no 6 | ORYX_ENABLE = yes 7 | -------------------------------------------------------------------------------- /keyboards/planck/planck.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "quantum.h" 4 | 5 | #define encoder_update(clockwise) encoder_update_user(uint8_t index, clockwise) 6 | 7 | #if defined(KEYBOARD_planck_ez) 8 | # include "ez.h" 9 | #endif // Planck revisions 10 | -------------------------------------------------------------------------------- /tmk_core/protocol/ps2_io.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void clock_init(void); 4 | void clock_lo(void); 5 | void clock_hi(void); 6 | bool clock_in(void); 7 | 8 | void data_init(void); 9 | void data_lo(void); 10 | void data_hi(void); 11 | bool data_in(void); 12 | -------------------------------------------------------------------------------- /tmk_core/common/virtser.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Define this function in your code to process incoming bytes */ 4 | void virtser_recv(const uint8_t ch); 5 | 6 | /* Call this to send a character over the Virtual Serial Device */ 7 | void virtser_send(const uint8_t byte); 8 | -------------------------------------------------------------------------------- /lib/python/qmk/tests/test_qmk_errors.py: -------------------------------------------------------------------------------- 1 | from qmk.errors import NoSuchKeyboardError 2 | 3 | 4 | def test_nosuchkeyboarderror(): 5 | try: 6 | raise NoSuchKeyboardError("test message") 7 | except NoSuchKeyboardError as e: 8 | assert e.message == 'test message' 9 | -------------------------------------------------------------------------------- /platforms/chibios/IC_TEENSY_3_1/board/board.mk: -------------------------------------------------------------------------------- 1 | # List of all the board related files. 2 | BOARDSRC = $(BOARD_PATH)/board/board.c 3 | 4 | # Required include directories 5 | BOARDINC = $(BOARD_PATH)/board 6 | 7 | # Shared variables 8 | ALLCSRC += $(BOARDSRC) 9 | ALLINC += $(BOARDINC) 10 | -------------------------------------------------------------------------------- /platforms/chibios/GENERIC_STM32_F042X6/board/board.mk: -------------------------------------------------------------------------------- 1 | # List of all the board related files. 2 | BOARDSRC = $(BOARD_PATH)/board/board.c 3 | 4 | # Required include directories 5 | BOARDINC = $(BOARD_PATH)/board 6 | 7 | # Shared variables 8 | ALLCSRC += $(BOARDSRC) 9 | ALLINC += $(BOARDINC) 10 | -------------------------------------------------------------------------------- /platforms/chibios/STM32_F103_STM32DUINO/board/board.mk: -------------------------------------------------------------------------------- 1 | # List of all the board related files. 2 | BOARDSRC = $(BOARD_PATH)/board/board.c 3 | 4 | # Required include directories 5 | BOARDINC = $(BOARD_PATH)/board 6 | 7 | # Shared variables 8 | ALLCSRC += $(BOARDSRC) 9 | ALLINC += $(BOARDINC) 10 | -------------------------------------------------------------------------------- /tmk_core/protocol/midi.mk: -------------------------------------------------------------------------------- 1 | MIDI_DIR = protocol/midi 2 | 3 | SRC += midi.c \ 4 | midi_device.c \ 5 | bytequeue/bytequeue.c \ 6 | bytequeue/interrupt_setting.c \ 7 | sysex_tools.c \ 8 | qmk_midi.c \ 9 | $(LUFA_SRC_USBCLASS) 10 | 11 | VPATH += $(TMK_PATH)/$(MIDI_DIR) 12 | -------------------------------------------------------------------------------- /quantum/split_common/split_util.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | extern volatile bool isLeftHand; 9 | 10 | void matrix_master_OLED_init(void); 11 | void split_pre_init(void); 12 | void split_post_init(void); 13 | -------------------------------------------------------------------------------- /quantum/process_keycode/process_joystick.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "quantum.h" 5 | 6 | bool process_joystick(uint16_t keycode, keyrecord_t *record); 7 | 8 | void joystick_task(void); 9 | 10 | bool process_joystick_analogread(void); 11 | bool process_joystick_analogread_quantum(void); 12 | -------------------------------------------------------------------------------- /quantum/tools/readme.md: -------------------------------------------------------------------------------- 1 | `eeprom_reset.hex` is to reset the eeprom on the Atmega32u4, like this: 2 | 3 | dfu-programmer atmega32u4 erase 4 | dfu-programmer atmega32u4 flash --eeprom eeprom_reset.hex 5 | 6 | You'll need to reflash afterwards, because DFU requires the flash to be erased before messing with the eeprom. 7 | -------------------------------------------------------------------------------- /quantum/velocikey.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | bool velocikey_enabled(void); 7 | void velocikey_toggle(void); 8 | void velocikey_accelerate(void); 9 | void velocikey_decelerate(void); 10 | uint8_t velocikey_match_speed(uint8_t minValue, uint8_t maxValue); 11 | -------------------------------------------------------------------------------- /tmk_core/protocol/arm_atsam/usb/usb_util.h: -------------------------------------------------------------------------------- 1 | #ifndef _USB_UTIL_H_ 2 | #define _USB_UTIL_H_ 3 | 4 | int UTIL_ltoa_radix(int64_t value, char *dest, int radix); 5 | int UTIL_ltoa(int64_t value, char *dest); 6 | int UTIL_itoa(int value, char *dest); 7 | int UTIL_utoa(uint32_t value, char *dest); 8 | 9 | #endif //_USB_UTIL_H_ 10 | -------------------------------------------------------------------------------- /platforms/chibios/GENERIC_STM32_F042X6/configs/bootloader_defs.h: -------------------------------------------------------------------------------- 1 | /* Address for jumping to bootloader on STM32 chips. */ 2 | /* It is chip dependent, the correct number can be looked up here: 3 | * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf 4 | */ 5 | #define STM32_BOOTLOADER_ADDRESS 0x1FFFC400 6 | -------------------------------------------------------------------------------- /platforms/chibios/GENERIC_STM32_F303XC/configs/bootloader_defs.h: -------------------------------------------------------------------------------- 1 | /* Address for jumping to bootloader on STM32 chips. */ 2 | /* It is chip dependent, the correct number can be looked up here: 3 | * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf 4 | */ 5 | #define STM32_BOOTLOADER_ADDRESS 0x1FFFD800 6 | -------------------------------------------------------------------------------- /quantum/split_common/transport.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "common/matrix.h" 4 | 5 | void transport_master_init(void); 6 | void transport_slave_init(void); 7 | 8 | // returns false if valid data not received from slave 9 | bool transport_master(matrix_row_t matrix[]); 10 | void transport_slave(matrix_row_t matrix[]); 11 | -------------------------------------------------------------------------------- /platforms/chibios/BLACKPILL_STM32_F411/board/board.mk: -------------------------------------------------------------------------------- 1 | # List of all the board related files. 2 | BOARDSRC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_F411RE/board.c 3 | 4 | # Required include directories 5 | BOARDINC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_F411RE 6 | 7 | # Shared variables 8 | ALLCSRC += $(BOARDSRC) 9 | ALLINC += $(BOARDINC) 10 | -------------------------------------------------------------------------------- /platforms/chibios/GENERIC_STM32_F072XB/board/board.mk: -------------------------------------------------------------------------------- 1 | # List of all the board related files. 2 | BOARDSRC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_F072RB/board.c 3 | 4 | # Required include directories 5 | BOARDINC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_F072RB 6 | 7 | # Shared variables 8 | ALLCSRC += $(BOARDSRC) 9 | ALLINC += $(BOARDINC) 10 | -------------------------------------------------------------------------------- /platforms/chibios/GENERIC_STM32_F072XB/configs/bootloader_defs.h: -------------------------------------------------------------------------------- 1 | /* Address for jumping to bootloader on STM32 chips. */ 2 | /* It is chip dependent, the correct number can be looked up here (page 175): 3 | * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf 4 | */ 5 | #define STM32_BOOTLOADER_ADDRESS 0x1FFFC800 6 | -------------------------------------------------------------------------------- /platforms/chibios/GENERIC_STM32_F303XC/board/board.mk: -------------------------------------------------------------------------------- 1 | # List of all the board related files. 2 | BOARDSRC = $(CHIBIOS)/os/hal/boards/ST_STM32F3_DISCOVERY/board.c 3 | 4 | # Required include directories 5 | BOARDINC = $(CHIBIOS)/os/hal/boards/ST_STM32F3_DISCOVERY 6 | 7 | # Shared variables 8 | ALLCSRC += $(BOARDSRC) 9 | ALLINC += $(BOARDINC) 10 | -------------------------------------------------------------------------------- /keyboards/ergodox_ez/util/readme.md: -------------------------------------------------------------------------------- 1 | # ErgoDox EZ Utilities 2 | 3 | The Python script in this directory, by [mbarkhau](https://github.com/mbarkhau) allows you to write out a basic ErgoDox EZ keymap using Markdown notation, and then transpile it to C, which you can then compile. It's experimental, but if you're not comfortable using C, it's a nice option. 4 | -------------------------------------------------------------------------------- /quantum/process_keycode/process_audio.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | float compute_freq_for_midi_note(uint8_t note); 4 | 5 | bool process_audio(uint16_t keycode, keyrecord_t *record); 6 | void process_audio_noteon(uint8_t note); 7 | void process_audio_noteoff(uint8_t note); 8 | void process_audio_all_notes_off(void); 9 | 10 | void audio_on_user(void); 11 | -------------------------------------------------------------------------------- /platforms/chibios/BLACKPILL_STM32_F401/board/board.mk: -------------------------------------------------------------------------------- 1 | # List of all the board related files. 2 | BOARDSRC = $(CHIBIOS)/os/hal/boards/ST_STM32F401C_DISCOVERY/board.c 3 | 4 | # Required include directories 5 | BOARDINC = $(CHIBIOS)/os/hal/boards/ST_STM32F401C_DISCOVERY 6 | 7 | # Shared variables 8 | ALLCSRC += $(BOARDSRC) 9 | ALLINC += $(BOARDINC) 10 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/arduino-1.0.1/cores/arduino/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(void) 4 | { 5 | init(); 6 | 7 | #if defined(USBCON) 8 | USBDevice.attach(); 9 | #endif 10 | 11 | setup(); 12 | 13 | for (;;) { 14 | loop(); 15 | if (serialEventRun) serialEventRun(); 16 | } 17 | 18 | return 0; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /tmk_core/protocol/midi/qmk_midi.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef MIDI_ENABLE 4 | # include "midi.h" 5 | # include 6 | extern MidiDevice midi_device; 7 | void setup_midi(void); 8 | void send_midi_packet(MIDI_EventPacket_t* event); 9 | bool recv_midi_packet(MIDI_EventPacket_t* const event); 10 | #endif 11 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/parser.h: -------------------------------------------------------------------------------- 1 | #ifndef PARSER_H 2 | #define PARSER_H 3 | 4 | #include "hid.h" 5 | #include "report.h" 6 | 7 | class KBDReportParser : public HIDReportParser 8 | { 9 | public: 10 | report_keyboard_t report; 11 | uint16_t time_stamp; 12 | virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf); 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /util/list_keyboards.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Temporary shell script to find keyboards 3 | # 4 | # This allows us to exclude keyboards by including a .noci file. 5 | 6 | find -L keyboards -type f -name rules.mk | grep -v keymaps | sed 's!keyboards/\(.*\)/rules.mk!\1!' | while read keyboard; do 7 | [ "$1" = "noci" -a -e "keyboards/${keyboard}/.noci" ] || echo "$keyboard" 8 | done 9 | -------------------------------------------------------------------------------- /util/vagrant/readme.md: -------------------------------------------------------------------------------- 1 | # QMK Vagrant Utilities 2 | 3 | ## Dockerfile 4 | Vagrant-friendly `qmkfm/base_container`. 5 | 6 | In order for the Docker provider and `vagrant ssh` to function the container has a few extra requirements. 7 | 8 | * vagrant user 9 | * ssh server 10 | * configured with expected public key 11 | * sudo 12 | * passwordless for vagrant user 13 | -------------------------------------------------------------------------------- /lib/python/qmk/tests/attrdict.py: -------------------------------------------------------------------------------- 1 | class AttrDict(dict): 2 | """A dictionary that can be accessed by attributes. 3 | 4 | This should only be used to mock objects for unit testing. Please do not use this outside of qmk.tests. 5 | """ 6 | def __init__(self, *args, **kwargs): 7 | super(AttrDict, self).__init__(*args, **kwargs) 8 | self.__dict__ = self 9 | -------------------------------------------------------------------------------- /platforms/chibios/GENERIC_STM32_F303XC/configs/proton_c.mk: -------------------------------------------------------------------------------- 1 | # Proton C MCU settings for converting AVR projects 2 | MCU = STM32F303 3 | 4 | # These are defaults based on what has been implemented for ARM boards 5 | AUDIO_ENABLE = yes 6 | WS2812_DRIVER = bitbang 7 | 8 | # Force task driven PWM until ARM can provide automatic configuration 9 | BACKLIGHT_DRIVER = software 10 | -------------------------------------------------------------------------------- /quantum/process_keycode/process_clicky.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void clicky_play(void); 4 | bool process_clicky(uint16_t keycode, keyrecord_t *record); 5 | 6 | void clicky_freq_up(void); 7 | void clicky_freq_down(void); 8 | void clicky_freq_reset(void); 9 | 10 | void clicky_toggle(void); 11 | void clicky_on(void); 12 | void clicky_off(void); 13 | 14 | bool is_clicky_on(void); 15 | -------------------------------------------------------------------------------- /tmk_core/common/sleep_led.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef SLEEP_LED_ENABLE 4 | 5 | void sleep_led_init(void); 6 | void sleep_led_enable(void); 7 | void sleep_led_disable(void); 8 | void sleep_led_toggle(void); 9 | 10 | #else 11 | 12 | # define sleep_led_init() 13 | # define sleep_led_enable() 14 | # define sleep_led_disable() 15 | # define sleep_led_toggle() 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /keyboards/planck/keymaps/oryx/config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef AUDIO_ENABLE 4 | #define STARTUP_SONG SONG(PLANCK_SOUND) 5 | #endif 6 | 7 | #define MIDI_BASIC 8 | 9 | #define ENCODER_RESOLUTION 4 10 | 11 | /* 12 | Set any config.h overrides for your specific keymap here. 13 | See config.h options at https://docs.qmk.fm/#/config_options?id=the-configh-file 14 | */ 15 | 16 | #define LAYER_STATE_8BIT 17 | -------------------------------------------------------------------------------- /quantum/debounce.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // raw is the current key state 4 | // on entry cooked is the previous debounced state 5 | // on exit cooked is the current debounced state 6 | // changed is true if raw has changed since the last call 7 | void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed); 8 | 9 | bool debounce_active(void); 10 | 11 | void debounce_init(uint8_t num_rows); 12 | -------------------------------------------------------------------------------- /tmk_core/protocol/vusb.mk: -------------------------------------------------------------------------------- 1 | VUSB_DIR = protocol/vusb 2 | 3 | # Path to the V-USB library 4 | VUSB_PATH = $(LIB_PATH)/vusb 5 | 6 | SRC += $(VUSB_DIR)/main.c \ 7 | $(VUSB_DIR)/vusb.c \ 8 | $(VUSB_PATH)/usbdrv/usbdrv.c \ 9 | $(VUSB_PATH)/usbdrv/usbdrvasm.S \ 10 | $(VUSB_PATH)/usbdrv/oddebug.c 11 | 12 | # Search Path 13 | VPATH += $(TMK_PATH)/$(VUSB_DIR) 14 | VPATH += $(VUSB_PATH) 15 | 16 | OPT_DEFS += -DPROTOCOL_VUSB 17 | -------------------------------------------------------------------------------- /lib/python/qmk/cli/list/keyboards.py: -------------------------------------------------------------------------------- 1 | """List the keyboards currently defined within QMK 2 | """ 3 | from milc import cli 4 | 5 | import qmk.keyboard 6 | 7 | 8 | @cli.subcommand("List the keyboards currently defined within QMK") 9 | def list_keyboards(cli): 10 | """List the keyboards currently defined within QMK 11 | """ 12 | for keyboard_name in qmk.keyboard.list_keyboards(): 13 | print(keyboard_name) 14 | -------------------------------------------------------------------------------- /quantum/tools/eeprom_reset.hex: -------------------------------------------------------------------------------- 1 | :10000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 2 | :10001000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0 3 | :10002000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 4 | :10003000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0 5 | :10004000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0 6 | :10005000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0 7 | :10006000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA0 8 | :10007000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF90 9 | :00000001FF 10 | -------------------------------------------------------------------------------- /lib/python/qmk/tests/test_qmk_path.py: -------------------------------------------------------------------------------- 1 | import os 2 | from pathlib import Path 3 | 4 | import qmk.path 5 | 6 | 7 | def test_keymap_onekey_pytest(): 8 | path = qmk.path.keymap('handwired/onekey/pytest') 9 | assert path.samefile('keyboards/handwired/onekey/keymaps') 10 | 11 | 12 | def test_normpath(): 13 | path = qmk.path.normpath('lib/python') 14 | assert path.samefile(Path(os.environ['ORIG_CWD']) / 'lib/python') 15 | -------------------------------------------------------------------------------- /lib/python/qmk/cli/hello.py: -------------------------------------------------------------------------------- 1 | """QMK Python Hello World 2 | 3 | This is an example QMK CLI script. 4 | """ 5 | from milc import cli 6 | 7 | 8 | @cli.argument('-n', '--name', default='World', help='Name to greet.') 9 | @cli.subcommand('QMK Hello World.', hidden=False if cli.config.user.developer else True) 10 | def hello(cli): 11 | """Log a friendly greeting. 12 | """ 13 | cli.log.info('Hello, %s!', cli.config.hello.name) 14 | -------------------------------------------------------------------------------- /lib/python/qmk/cli/fileformat.py: -------------------------------------------------------------------------------- 1 | """Format files according to QMK's style. 2 | """ 3 | from milc import cli 4 | 5 | import subprocess 6 | 7 | 8 | @cli.subcommand("Format files according to QMK's style.", hidden=True) 9 | def fileformat(cli): 10 | """Run several general formatting commands. 11 | """ 12 | dos2unix = subprocess.run(['bash', '-c', 'git ls-files -z | xargs -0 dos2unix'], stdout=subprocess.DEVNULL) 13 | return dos2unix.returncode 14 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/arduino-1.0.1/cores/arduino/new.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void * operator new(size_t size) 4 | { 5 | return malloc(size); 6 | } 7 | 8 | void operator delete(void * ptr) 9 | { 10 | free(ptr); 11 | } 12 | 13 | int __cxa_guard_acquire(__guard *g) {return !*(char *)(g);}; 14 | void __cxa_guard_release (__guard *g) {*(char *)g = 1;}; 15 | void __cxa_guard_abort (__guard *) {}; 16 | 17 | void __cxa_pure_virtual(void) {}; 18 | 19 | -------------------------------------------------------------------------------- /drivers/qwiic/qwiic.mk: -------------------------------------------------------------------------------- 1 | ifneq ($(strip $(QWIIC_ENABLE)),) 2 | COMMON_VPATH += $(DRIVER_PATH)/qwiic 3 | OPT_DEFS += -DQWIIC_ENABLE 4 | SRC += qwiic.c 5 | QUANTUM_LIB_SRC += i2c_master.c 6 | endif 7 | 8 | ifneq ($(filter JOYSTIIC, $(QWIIC_ENABLE)),) 9 | OPT_DEFS += -DQWIIC_JOYSTIIC_ENABLE 10 | SRC += joystiic.c 11 | endif 12 | 13 | ifneq ($(filter MICRO_OLED, $(QWIIC_ENABLE)),) 14 | OPT_DEFS += -DQWIIC_MICRO_OLED_ENABLE 15 | SRC += micro_oled.c 16 | endif 17 | -------------------------------------------------------------------------------- /keyboards/ergodox_ez/glow/keymaps/reactive/config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define RGB_MATRIX_KEYPRESSES 4 | #define RGB_MATRIX_FRAMEBUFFER_EFFECTS 5 | 6 | #define DISABLE_RGB_MATRIX_DIGITAL_RAIN 7 | #define DISABLE_RGB_MATRIX_ALPHAS_MODS 8 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE 9 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS 10 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS 11 | #define DISABLE_RGB_MATRIX_SPLASH 12 | #define DISABLE_RGB_MATRIX_SOLID_SPLASH 13 | -------------------------------------------------------------------------------- /util/usb_detach/Makefile: -------------------------------------------------------------------------------- 1 | # the compiler: gcc for C program, define as g++ for C++ 2 | CC = gcc 3 | 4 | # compiler flags: 5 | # -g adds debugging information to the executable file 6 | # -Wall turns on most, but not all, compiler warnings 7 | CFLAGS = -g -Wall 8 | 9 | # the build target executable: 10 | TARGET = usb_detach 11 | 12 | all: $(TARGET) 13 | 14 | $(TARGET): $(TARGET).c 15 | $(CC) $(CFLAGS) -o $(TARGET) $(TARGET).c 16 | 17 | clean: 18 | $(RM) $(TARGET) 19 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/cycle_all_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_CYCLE_ALL 2 | RGB_MATRIX_EFFECT(CYCLE_ALL) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | static HSV CYCLE_ALL_math(HSV hsv, uint8_t i, uint8_t time) { 6 | hsv.h = time; 7 | return hsv; 8 | } 9 | 10 | bool CYCLE_ALL(effect_params_t* params) { return effect_runner_i(params, &CYCLE_ALL_math); } 11 | 12 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 13 | #endif // DISABLE_RGB_MATRIX_CYCLE_ALL 14 | -------------------------------------------------------------------------------- /util/install/linux_shared.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # For those distros that do not package bootloadHID 4 | _qmk_install_bootloadhid() { 5 | if ! command -v bootloadHID > /dev/null; then 6 | wget https://www.obdev.at/downloads/vusb/bootloadHID.2012-12-08.tar.gz -O - | tar -xz -C /tmp 7 | pushd /tmp/bootloadHID.2012-12-08/commandline/ > /dev/null 8 | if make; then 9 | sudo cp bootloadHID /usr/local/bin 10 | fi 11 | popd > /dev/null 12 | fi 13 | } 14 | -------------------------------------------------------------------------------- /quantum/joystick.c: -------------------------------------------------------------------------------- 1 | #include "joystick.h" 2 | 3 | joystick_t joystick_status = {.buttons = {0}, 4 | .axes = 5 | { 6 | #if JOYSTICK_AXES_COUNT > 0 7 | 0 8 | #endif 9 | }, 10 | .status = 0}; 11 | 12 | // array defining the reading of analog values for each axis 13 | __attribute__((weak)) joystick_config_t joystick_axes[JOYSTICK_AXES_COUNT] = {}; 14 | -------------------------------------------------------------------------------- /tmk_core/common/suspend.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void suspend_idle(uint8_t timeout); 7 | void suspend_power_down(void); 8 | bool suspend_wakeup_condition(void); 9 | void suspend_wakeup_init(void); 10 | 11 | void suspend_wakeup_init_user(void); 12 | void suspend_wakeup_init_kb(void); 13 | void suspend_power_down_user(void); 14 | void suspend_power_down_kb(void); 15 | 16 | #ifndef USB_SUSPEND_WAKEUP_DELAY 17 | # define USB_SUSPEND_WAKEUP_DELAY 200 18 | #endif 19 | -------------------------------------------------------------------------------- /util/install/void.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | _qmk_install() { 4 | echo "Installing dependencies" 5 | 6 | sudo xbps-install \ 7 | gcc git make wget unzip zip \ 8 | python3-pip \ 9 | avr-binutils avr-gcc avr-libc \ 10 | cross-arm-none-eabi-binutils cross-arm-none-eabi-gcc cross-arm-none-eabi-newlib \ 11 | avrdude dfu-programmer dfu-util teensy_loader_cli \ 12 | libusb-compat-devel 13 | 14 | python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt 15 | } 16 | -------------------------------------------------------------------------------- /util/install/freebsd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | _qmk_install_prepare() { 4 | sudo pkg update 5 | } 6 | 7 | _qmk_install() { 8 | echo "Installing dependencies" 9 | 10 | sudo pkg install -y \ 11 | git wget gmake gcc zip unzip diffutils \ 12 | python3 \ 13 | avr-binutils avr-gcc avr-libc \ 14 | arm-none-eabi-binutils arm-none-eabi-gcc arm-none-eabi-newlib \ 15 | avrdude dfu-programmer dfu-util 16 | 17 | sudo python3 -m pip install -r $QMK_FIRMWARE_DIR/requirements.txt 18 | } 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/other_issues.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Other issues 3 | about: Anything else that doesn't fall into the above categories. 4 | --- 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tmk_core/make_dfu_header.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ALL_CONFIGS=$* 3 | GREP="grep" 4 | 5 | cat <<- EOF > lib/lufa/Bootloaders/DFU/Keyboard.h 6 | #pragma once 7 | 8 | $($GREP "MANUFACTURER[ \t]" $ALL_CONFIGS -h | tail -1) 9 | $($GREP "PRODUCT[ \t]" $ALL_CONFIGS -h | tail -1 | tr -d '\r') Bootloader 10 | $($GREP "QMK_ESC_OUTPUT[ \t]" $ALL_CONFIGS -h | tail -1) 11 | $($GREP "QMK_ESC_INPUT[ \t]" $ALL_CONFIGS -h | tail -1) 12 | $($GREP "QMK_LED[ \t]" $ALL_CONFIGS -h | tail -1) 13 | $($GREP "QMK_SPEAKER[ \t]" $ALL_CONFIGS -h | tail -1) 14 | EOF 15 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/cycle_up_down_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_CYCLE_UP_DOWN 2 | RGB_MATRIX_EFFECT(CYCLE_UP_DOWN) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | static HSV CYCLE_UP_DOWN_math(HSV hsv, uint8_t i, uint8_t time) { 6 | hsv.h = g_led_config.point[i].y - time; 7 | return hsv; 8 | } 9 | 10 | bool CYCLE_UP_DOWN(effect_params_t* params) { return effect_runner_i(params, &CYCLE_UP_DOWN_math); } 11 | 12 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 13 | #endif // DISABLE_RGB_MATRIX_CYCLE_UP_DOWN 14 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/parser.cpp: -------------------------------------------------------------------------------- 1 | #include "parser.h" 2 | #include "usb_hid.h" 3 | 4 | #include "debug.h" 5 | 6 | 7 | void KBDReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) 8 | { 9 | ::memcpy(&report, buf, sizeof(report_keyboard_t)); 10 | time_stamp = millis(); 11 | 12 | dprintf("input %d: %02X %02X", hid->GetAddress(), report.mods, report.reserved); 13 | for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { 14 | dprintf(" %02X", report.keys[i]); 15 | } 16 | dprint("\r\n"); 17 | } 18 | -------------------------------------------------------------------------------- /lib/python/qmk/cli/pytest.py: -------------------------------------------------------------------------------- 1 | """QMK Python Unit Tests 2 | 3 | QMK script to run unit and integration tests against our python code. 4 | """ 5 | import subprocess 6 | 7 | from milc import cli 8 | 9 | 10 | @cli.subcommand('QMK Python Unit Tests', hidden=False if cli.config.user.developer else True) 11 | def pytest(cli): 12 | """Run several linting/testing commands. 13 | """ 14 | flake8 = subprocess.run(['flake8', 'lib/python', 'bin/qmk']) 15 | nose2 = subprocess.run(['nose2', '-v']) 16 | return flake8.returncode | nose2.returncode 17 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/cycle_out_in_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_CYCLE_OUT_IN 2 | RGB_MATRIX_EFFECT(CYCLE_OUT_IN) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | static HSV CYCLE_OUT_IN_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) { 6 | hsv.h = 3 * dist / 2 + time; 7 | return hsv; 8 | } 9 | 10 | bool CYCLE_OUT_IN(effect_params_t* params) { return effect_runner_dx_dy_dist(params, &CYCLE_OUT_IN_math); } 11 | 12 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 13 | #endif // DISABLE_RGB_MATRIX_CYCLE_OUT_IN 14 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/cycle_pinwheel_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_CYCLE_PINWHEEL 2 | RGB_MATRIX_EFFECT(CYCLE_PINWHEEL) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | static HSV CYCLE_PINWHEEL_math(HSV hsv, int16_t dx, int16_t dy, uint8_t time) { 6 | hsv.h = atan2_8(dy, dx) + time; 7 | return hsv; 8 | } 9 | 10 | bool CYCLE_PINWHEEL(effect_params_t* params) { return effect_runner_dx_dy(params, &CYCLE_PINWHEEL_math); } 11 | 12 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 13 | #endif // DISABLE_RGB_MATRIX_CYCLE_PINWHEEL 14 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/solid_color_anim.h: -------------------------------------------------------------------------------- 1 | RGB_MATRIX_EFFECT(SOLID_COLOR) 2 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 3 | 4 | bool SOLID_COLOR(effect_params_t* params) { 5 | RGB_MATRIX_USE_LIMITS(led_min, led_max); 6 | 7 | RGB rgb = rgb_matrix_hsv_to_rgb(rgb_matrix_config.hsv); 8 | for (uint8_t i = led_min; i < led_max; i++) { 9 | RGB_MATRIX_TEST_LED_FLAGS(); 10 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); 11 | } 12 | return led_max < DRIVER_LED_TOTAL; 13 | } 14 | 15 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 16 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/cycle_left_right_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT 2 | RGB_MATRIX_EFFECT(CYCLE_LEFT_RIGHT) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | static HSV CYCLE_LEFT_RIGHT_math(HSV hsv, uint8_t i, uint8_t time) { 6 | hsv.h = g_led_config.point[i].x - time; 7 | return hsv; 8 | } 9 | 10 | bool CYCLE_LEFT_RIGHT(effect_params_t* params) { return effect_runner_i(params, &CYCLE_LEFT_RIGHT_math); } 11 | 12 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 13 | #endif // DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT 14 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/arduino-1.0.1/cores/arduino/Platform.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __PLATFORM_H__ 3 | #define __PLATFORM_H__ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | typedef unsigned char u8; 12 | typedef unsigned short u16; 13 | typedef unsigned long u32; 14 | 15 | #include "Arduino.h" 16 | 17 | #if defined(USBCON) 18 | #include "USBDesc.h" 19 | #include "USBCore.h" 20 | #include "USBAPI.h" 21 | #endif /* if defined(USBCON) */ 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /lib/python/qmk/tests/kle.txt: -------------------------------------------------------------------------------- 1 | ["¬\n`","!\n1","\"\n2","£\n3","$\n4","%\n5","^\n6","&\n7","*\n8","(\n9",")\n0","_\n-","+\n=",{w:2},"Backspace"], 2 | [{w:1.5},"Tab","Q","W","E","R","T","Y","U","I","O","P","{\n[","}\n]",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},"Enter"], 3 | [{w:1.75},"Caps Lock","A","S","D","F","G","H","J","K","L",":\n;","@\n'","~\n#"], 4 | [{w:1.25},"Shift","|\n\\","Z","X","C","V","B","N","M","<\n,",">\n.","?\n/",{w:2.75},"Shift"], 5 | [{w:1.25},"Ctrl",{w:1.25},"Win",{w:1.25},"Alt",{a:7,w:6.25},"",{a:4,w:1.25},"AltGr",{w:1.25},"Win",{w:1.25},"Menu",{w:1.25},"Ctrl"] 6 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/cycle_spiral_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_CYCLE_SPIRAL 2 | RGB_MATRIX_EFFECT(CYCLE_SPIRAL) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | static HSV CYCLE_SPIRAL_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) { 6 | hsv.h = dist - time - atan2_8(dy, dx); 7 | return hsv; 8 | } 9 | 10 | bool CYCLE_SPIRAL(effect_params_t* params) { return effect_runner_dx_dy_dist(params, &CYCLE_SPIRAL_math); } 11 | 12 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 13 | #endif // DISABLE_RGB_MATRIX_CYCLE_SPIRAL 14 | -------------------------------------------------------------------------------- /util/install/solus.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | _qmk_install_prepare() { 4 | sudo eopkg -y update-repo 5 | sudo eopkg -y upgrade 6 | } 7 | 8 | _qmk_install() { 9 | echo "Installing dependencies" 10 | 11 | sudo eopkg -y install \ 12 | -c system.devel git wget zip unzip \ 13 | python3 \ 14 | avr-binutils avr-gcc avr-libc \ 15 | arm-none-eabi-binutils arm-none-eabi-gcc arm-none-eabi-newlib \ 16 | avrdude dfu-programmer dfu-util 17 | 18 | python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt 19 | } 20 | -------------------------------------------------------------------------------- /quantum/template/base/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "keyboard_name": "%KEYBOARD%", 3 | "url": "", 4 | "maintainer": "%YOUR_NAME%", 5 | "width": 3, 6 | "height": 2, 7 | "layouts": { 8 | "LAYOUT": { 9 | "layout": [ 10 | {"label": "k00", "x": 0, "y": 0}, 11 | {"label": "k01", "x": 1, "y": 0}, 12 | {"label": "k02", "x": 2, "y": 0}, 13 | 14 | {"label": "k10", "x": 0, "y": 1, "w": 1.5}, 15 | {"label": "k12", "x": 1.5, "y": 1, "w": 1.5} 16 | ] 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/colorband_sat_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_BAND_SAT 2 | RGB_MATRIX_EFFECT(BAND_SAT) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | static HSV BAND_SAT_math(HSV hsv, uint8_t i, uint8_t time) { 6 | int16_t s = hsv.s - abs(scale8(g_led_config.point[i].x, 228) + 28 - time) * 8; 7 | hsv.s = scale8(s < 0 ? 0 : s, hsv.s); 8 | return hsv; 9 | } 10 | 11 | bool BAND_SAT(effect_params_t* params) { return effect_runner_i(params, &BAND_SAT_math); } 12 | 13 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 14 | #endif // DISABLE_RGB_MATRIX_BAND_SAT 15 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/colorband_val_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_BAND_VAL 2 | RGB_MATRIX_EFFECT(BAND_VAL) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | static HSV BAND_VAL_math(HSV hsv, uint8_t i, uint8_t time) { 6 | int16_t v = hsv.v - abs(scale8(g_led_config.point[i].x, 228) + 28 - time) * 8; 7 | hsv.v = scale8(v < 0 ? 0 : v, hsv.v); 8 | return hsv; 9 | } 10 | 11 | bool BAND_VAL(effect_params_t* params) { return effect_runner_i(params, &BAND_VAL_math); } 12 | 13 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 14 | #endif // DISABLE_RGB_MATRIX_BAND_VAL 15 | -------------------------------------------------------------------------------- /util/install/fedora.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | _qmk_install() { 4 | echo "Installing dependencies" 5 | 6 | # TODO: Check whether devel/headers packages are really needed 7 | sudo dnf -y install \ 8 | clang diffutils git gcc glibc-headers kernel-devel kernel-headers make unzip wget zip \ 9 | python3 \ 10 | avr-binutils avr-gcc avr-libc \ 11 | arm-none-eabi-binutils-cs arm-none-eabi-gcc-cs arm-none-eabi-newlib \ 12 | avrdude dfu-programmer dfu-util libusb-devel 13 | 14 | python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt 15 | } 16 | -------------------------------------------------------------------------------- /tmk_core/protocol/chibios.mk: -------------------------------------------------------------------------------- 1 | PROTOCOL_DIR = protocol 2 | CHIBIOS_DIR = $(PROTOCOL_DIR)/chibios 3 | 4 | 5 | SRC += $(CHIBIOS_DIR)/usb_main.c 6 | SRC += $(CHIBIOS_DIR)/main.c 7 | SRC += usb_descriptor.c 8 | SRC += $(CHIBIOS_DIR)/usb_driver.c 9 | SRC += $(LIBSRC) 10 | 11 | VPATH += $(TMK_PATH)/$(PROTOCOL_DIR) 12 | VPATH += $(TMK_PATH)/$(CHIBIOS_DIR) 13 | VPATH += $(TMK_PATH)/$(CHIBIOS_DIR)/lufa_utils 14 | 15 | OPT_DEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=64 16 | OPT_DEFS += -DFIXED_NUM_CONFIGURATIONS=1 17 | 18 | ifeq ($(strip $(MIDI_ENABLE)), yes) 19 | include $(TMK_PATH)/protocol/midi.mk 20 | endif 21 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/override_wiring.c: -------------------------------------------------------------------------------- 1 | /* 2 | * To keep Timer0 for common/timer.c override arduino/wiring.c. 3 | */ 4 | #define __DELAY_BACKWARD_COMPATIBLE__ 5 | #include 6 | #include "common/timer.h" 7 | 8 | 9 | unsigned long millis(void) 10 | { 11 | return timer_read32(); 12 | } 13 | unsigned long micros(void) 14 | { 15 | return timer_read32() * 1000UL; 16 | } 17 | void delay(unsigned long ms) 18 | { 19 | _delay_ms(ms); 20 | } 21 | void delayMicroseconds(unsigned int us) 22 | { 23 | _delay_us(us); 24 | } 25 | void init(void) 26 | { 27 | timer_init(); 28 | } 29 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/colorband_pinwheel_sat_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT 2 | RGB_MATRIX_EFFECT(BAND_PINWHEEL_SAT) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | static HSV BAND_PINWHEEL_SAT_math(HSV hsv, int16_t dx, int16_t dy, uint8_t time) { 6 | hsv.s = scale8(hsv.s - time - atan2_8(dy, dx) * 3, hsv.s); 7 | return hsv; 8 | } 9 | 10 | bool BAND_PINWHEEL_SAT(effect_params_t* params) { return effect_runner_dx_dy(params, &BAND_PINWHEEL_SAT_math); } 11 | 12 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 13 | #endif // DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT 14 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/colorband_pinwheel_val_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL 2 | RGB_MATRIX_EFFECT(BAND_PINWHEEL_VAL) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | static HSV BAND_PINWHEEL_VAL_math(HSV hsv, int16_t dx, int16_t dy, uint8_t time) { 6 | hsv.v = scale8(hsv.v - time - atan2_8(dy, dx) * 3, hsv.v); 7 | return hsv; 8 | } 9 | 10 | bool BAND_PINWHEEL_VAL(effect_params_t* params) { return effect_runner_dx_dy(params, &BAND_PINWHEEL_VAL_math); } 11 | 12 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 13 | #endif // DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL 14 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/colorband_spiral_sat_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT 2 | RGB_MATRIX_EFFECT(BAND_SPIRAL_SAT) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | static HSV BAND_SPIRAL_SAT_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) { 6 | hsv.s = scale8(hsv.s + dist - time - atan2_8(dy, dx), hsv.s); 7 | return hsv; 8 | } 9 | 10 | bool BAND_SPIRAL_SAT(effect_params_t* params) { return effect_runner_dx_dy_dist(params, &BAND_SPIRAL_SAT_math); } 11 | 12 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 13 | #endif // DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT 14 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/colorband_spiral_val_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL 2 | RGB_MATRIX_EFFECT(BAND_SPIRAL_VAL) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | static HSV BAND_SPIRAL_VAL_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) { 6 | hsv.v = scale8(hsv.v + dist - time - atan2_8(dy, dx), hsv.v); 7 | return hsv; 8 | } 9 | 10 | bool BAND_SPIRAL_VAL(effect_params_t* params) { return effect_runner_dx_dy_dist(params, &BAND_SPIRAL_VAL_math); } 11 | 12 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 13 | #endif // DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL 14 | -------------------------------------------------------------------------------- /lib/python/qmk/cli/clean.py: -------------------------------------------------------------------------------- 1 | """Clean the QMK firmware folder of build artifacts. 2 | """ 3 | from qmk.commands import run 4 | from milc import cli 5 | 6 | import shutil 7 | 8 | 9 | @cli.argument('-a', '--all', arg_only=True, action='store_true', help='Remove *.hex and *.bin files in the QMK root as well.') 10 | @cli.subcommand('Clean the QMK firmware folder of build artifacts.') 11 | def clean(cli): 12 | """Runs `make clean` (or `make distclean` if --all is passed) 13 | """ 14 | make_cmd = 'gmake' if shutil.which('gmake') else 'make' 15 | 16 | run([make_cmd, 'distclean' if cli.args.all else 'clean']) 17 | -------------------------------------------------------------------------------- /util/install/sabayon.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | _qmk_install() { 4 | echo "Installing dependencies" 5 | 6 | sudo equo install \ 7 | app-arch/unzip app-arch/zip net-misc/wget dev-vcs/git sys-devel/clang sys-devel/gcc sys-devel/crossdev \ 8 | dev-python/pip \ 9 | dev-embedded/avrdude dev-embedded/dfu-programmer app-mobilephone/dfu-util 10 | 11 | sudo crossdev -s4 --stable --g \<9 --portage --verbose --target avr 12 | sudo crossdev -s4 --stable --g \<9 --portage --verbose --target arm-none-eabi 13 | 14 | python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt 15 | } 16 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_runners/effect_runner_i.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef HSV (*i_f)(HSV hsv, uint8_t i, uint8_t time); 4 | 5 | bool effect_runner_i(effect_params_t* params, i_f effect_func) { 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); 7 | 8 | uint8_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 4); 9 | for (uint8_t i = led_min; i < led_max; i++) { 10 | RGB_MATRIX_TEST_LED_FLAGS(); 11 | RGB rgb = rgb_matrix_hsv_to_rgb(effect_func(rgb_matrix_config.hsv, i, time)); 12 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); 13 | } 14 | return led_max < DRIVER_LED_TOTAL; 15 | } 16 | -------------------------------------------------------------------------------- /util/usb_detach/readme.md: -------------------------------------------------------------------------------- 1 | # usb_detach 2 | 3 | When trying to flash on Linux, you may encounter a "Resource Unavailable" error. This means that Linux's HID driver has taken exclusive control of the keyboard, and the program script can't flash it. 4 | This program can force Linux to give up a device, so that the programming script can reset it. 5 | 6 | ## To compile: 7 | ```bash 8 | make clean && make 9 | ``` 10 | 11 | ## To run: 12 | 1. Use `lsusb` to discover the Bus and Device numbers for your keyboard. 13 | 2. Run the program: `sudo ./usb_detach /dev/bus/usb//`. 14 | 3. Build and program the firmware as normal. 15 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/dual_beacon_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_DUAL_BEACON 2 | RGB_MATRIX_EFFECT(DUAL_BEACON) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | static HSV DUAL_BEACON_math(HSV hsv, int8_t sin, int8_t cos, uint8_t i, uint8_t time) { 6 | hsv.h += ((g_led_config.point[i].y - k_rgb_matrix_center.y) * cos + (g_led_config.point[i].x - k_rgb_matrix_center.x) * sin) / 128; 7 | return hsv; 8 | } 9 | 10 | bool DUAL_BEACON(effect_params_t* params) { return effect_runner_sin_cos_i(params, &DUAL_BEACON_math); } 11 | 12 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 13 | #endif // DISABLE_RGB_MATRIX_DUAL_BEACON 14 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/solid_reactive_anim.h: -------------------------------------------------------------------------------- 1 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED 2 | # ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE 3 | RGB_MATRIX_EFFECT(SOLID_REACTIVE) 4 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 5 | 6 | static HSV SOLID_REACTIVE_math(HSV hsv, uint16_t offset) { 7 | hsv.h += qsub8(130, offset); 8 | return hsv; 9 | } 10 | 11 | bool SOLID_REACTIVE(effect_params_t* params) { return effect_runner_reactive(params, &SOLID_REACTIVE_math); } 12 | 13 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 14 | # endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE 15 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED 16 | -------------------------------------------------------------------------------- /lib/python/qmk/comment_remover.py: -------------------------------------------------------------------------------- 1 | """Removes C/C++ style comments from text. 2 | 3 | Gratefully adapted from https://stackoverflow.com/a/241506 4 | """ 5 | import re 6 | 7 | comment_pattern = re.compile(r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"', re.DOTALL | re.MULTILINE) 8 | 9 | 10 | def _comment_stripper(match): 11 | """Removes C/C++ style comments from a regex match. 12 | """ 13 | s = match.group(0) 14 | return ' ' if s.startswith('/') else s 15 | 16 | 17 | def comment_remover(text): 18 | """Remove C/C++ style comments from text. 19 | """ 20 | return re.sub(comment_pattern, _comment_stripper, text) 21 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | * text eol=lf 4 | 5 | # Custom for Visual Studio 6 | *.cs diff=csharp 7 | *.sln merge=union 8 | *.csproj merge=union 9 | *.vbproj merge=union 10 | *.fsproj merge=union 11 | *.dbproj merge=union 12 | 13 | # Standard to msysgit 14 | *.doc diff=astextplain 15 | *.DOC diff=astextplain 16 | *.docx diff=astextplain 17 | *.DOCX diff=astextplain 18 | *.dot diff=astextplain 19 | *.DOT diff=astextplain 20 | *.pdf diff=astextplain 21 | *.PDF diff=astextplain 22 | *.rtf diff=astextplain 23 | *.RTF diff=astextplain 24 | -------------------------------------------------------------------------------- /quantum/sequencer/tests/rules.mk: -------------------------------------------------------------------------------- 1 | # The letter case of these variables might seem odd. However: 2 | # - it is consistent with the serial_link example that is used as a reference in the Unit Testing article (https://docs.qmk.fm/#/unit_testing?id=adding-tests-for-new-or-existing-features) 3 | # - Neither `make test:sequencer` or `make test:SEQUENCER` work when using SCREAMING_SNAKE_CASE 4 | 5 | sequencer_DEFS := -DNO_DEBUG -DMIDI_MOCKED 6 | 7 | sequencer_SRC := \ 8 | $(QUANTUM_PATH)/sequencer/tests/midi_mock.c \ 9 | $(QUANTUM_PATH)/sequencer/tests/sequencer_tests.cpp \ 10 | $(QUANTUM_PATH)/sequencer/sequencer.c \ 11 | $(TMK_PATH)/common/test/timer.c 12 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON 2 | RGB_MATRIX_EFFECT(RAINBOW_MOVING_CHEVRON) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | static HSV RAINBOW_MOVING_CHEVRON_math(HSV hsv, uint8_t i, uint8_t time) { 6 | hsv.h += abs8(g_led_config.point[i].y - k_rgb_matrix_center.y) + (g_led_config.point[i].x - time); 7 | return hsv; 8 | } 9 | 10 | bool RAINBOW_MOVING_CHEVRON(effect_params_t* params) { return effect_runner_i(params, &RAINBOW_MOVING_CHEVRON_math); } 11 | 12 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 13 | #endif // DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON 14 | -------------------------------------------------------------------------------- /lib/python/qmk/cli/pyformat.py: -------------------------------------------------------------------------------- 1 | """Format python code according to QMK's style. 2 | """ 3 | from milc import cli 4 | 5 | import subprocess 6 | 7 | 8 | @cli.subcommand("Format python code according to QMK's style.", hidden=False if cli.config.user.developer else True) 9 | def pyformat(cli): 10 | """Format python code according to QMK's style. 11 | """ 12 | try: 13 | subprocess.run(['yapf', '-vv', '-ri', 'bin/qmk', 'lib/python'], check=True) 14 | cli.log.info('Successfully formatted the python code in `bin/qmk` and `lib/python`.') 15 | 16 | except subprocess.CalledProcessError: 17 | cli.log.error('Error formatting python code!') 18 | -------------------------------------------------------------------------------- /tmk_core/common/arm_atsam/timer.c: -------------------------------------------------------------------------------- 1 | #include "samd51j18a.h" 2 | #include "timer.h" 3 | #include "tmk_core/protocol/arm_atsam/clks.h" 4 | 5 | void set_time(uint64_t tset) { ms_clk = tset; } 6 | 7 | void timer_init(void) { timer_clear(); } 8 | 9 | uint16_t timer_read(void) { return (uint16_t)ms_clk; } 10 | 11 | uint32_t timer_read32(void) { return (uint32_t)ms_clk; } 12 | 13 | uint64_t timer_read64(void) { return ms_clk; } 14 | 15 | uint16_t timer_elapsed(uint16_t tlast) { return TIMER_DIFF_16(timer_read(), tlast); } 16 | 17 | uint32_t timer_elapsed32(uint32_t tlast) { return TIMER_DIFF_32(timer_read32(), tlast); } 18 | 19 | void timer_clear(void) { set_time(0); } 20 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "examples/testusbhostFAT/generic_storage"] 2 | path = examples/testusbhostFAT/generic_storage 3 | url = https://github.com/xxxajk/generic_storage 4 | [submodule "examples/testusbhostFAT/xmem2"] 5 | path = examples/testusbhostFAT/xmem2 6 | url = https://github.com/xxxajk/xmem2 7 | [submodule "examples/testusbhostFAT/Arduino_Makefile_master"] 8 | path = examples/testusbhostFAT/Arduino_Makefile_master 9 | url = https://github.com/xxxajk/Arduino_Makefile_master 10 | [submodule "examples/testusbhostFAT/RTClib"] 11 | path = examples/testusbhostFAT/RTClib 12 | url = https://github.com/xxxajk/RTClib 13 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/rainbow_beacon_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_BEACON 2 | RGB_MATRIX_EFFECT(RAINBOW_BEACON) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | static HSV RAINBOW_BEACON_math(HSV hsv, int8_t sin, int8_t cos, uint8_t i, uint8_t time) { 6 | hsv.h += ((g_led_config.point[i].y - k_rgb_matrix_center.y) * 2 * cos + (g_led_config.point[i].x - k_rgb_matrix_center.x) * 2 * sin) / 128; 7 | return hsv; 8 | } 9 | 10 | bool RAINBOW_BEACON(effect_params_t* params) { return effect_runner_sin_cos_i(params, &RAINBOW_BEACON_math); } 11 | 12 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 13 | #endif // DISABLE_RGB_MATRIX_RAINBOW_BEACON 14 | -------------------------------------------------------------------------------- /tmk_core/common/progmem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(__AVR__) 4 | # include 5 | #else 6 | # define PROGMEM 7 | # define PGM_P const char* 8 | # define memcpy_P(dest, src, n) memcpy(dest, src, n) 9 | # define pgm_read_byte(address_short) *((uint8_t*)(address_short)) 10 | # define pgm_read_word(address_short) *((uint16_t*)(address_short)) 11 | # define pgm_read_dword(address_short) *((uint32_t*)(address_short)) 12 | # define pgm_read_ptr(address_short) *((void**)(address_short)) 13 | # define strcmp_P(s1, s2) strcmp(s1, s2) 14 | # define strcpy_P(dest, src) strcpy(dest, src) 15 | # define strlen_P(src) strlen(src) 16 | #endif 17 | -------------------------------------------------------------------------------- /tmk_core/native.mk: -------------------------------------------------------------------------------- 1 | SYSTEM_TYPE := $(shell gcc -dumpmachine) 2 | 3 | CC = gcc 4 | OBJCOPY = 5 | OBJDUMP = 6 | SIZE = 7 | AR = 8 | NM = 9 | HEX = 10 | EEP = 11 | BIN = 12 | 13 | 14 | COMPILEFLAGS += -funsigned-char 15 | COMPILEFLAGS += -funsigned-bitfields 16 | COMPILEFLAGS += -ffunction-sections 17 | COMPILEFLAGS += -fdata-sections 18 | COMPILEFLAGS += -fshort-enums 19 | ifneq ($(findstring mingw, ${SYSTEM_TYPE}),) 20 | COMPILEFLAGS += -mno-ms-bitfields 21 | endif 22 | 23 | CFLAGS += $(COMPILEFLAGS) 24 | CFLAGS += -fno-inline-small-functions 25 | CFLAGS += -fno-strict-aliasing 26 | 27 | CXXFLAGS += $(COMPILEFLAGS) 28 | CXXFLAGS += -fno-exceptions 29 | CXXFLAGS += -std=gnu++11 30 | -------------------------------------------------------------------------------- /testlist.mk: -------------------------------------------------------------------------------- 1 | TEST_LIST = $(notdir $(patsubst %/rules.mk,%,$(wildcard $(ROOT_DIR)/tests/*/rules.mk))) 2 | FULL_TESTS := $(TEST_LIST) 3 | 4 | include $(ROOT_DIR)/quantum/sequencer/tests/testlist.mk 5 | include $(ROOT_DIR)/quantum/serial_link/tests/testlist.mk 6 | 7 | define VALIDATE_TEST_LIST 8 | ifneq ($1,) 9 | ifeq ($$(findstring -,$1),-) 10 | $$(error Test names can't contain '-', but '$1' does) 11 | else 12 | $$(eval $$(call VALIDATE_TEST_LIST,$$(firstword $2),$$(wordlist 2,9999,$2))) 13 | endif 14 | endif 15 | endef 16 | 17 | 18 | $(eval $(call VALIDATE_TEST_LIST,$(firstword $(TEST_LIST)),$(wordlist 2,9999,$(TEST_LIST)))) 19 | -------------------------------------------------------------------------------- /drivers/avr/ws2812_i2c.c: -------------------------------------------------------------------------------- 1 | #include "ws2812.h" 2 | #include "i2c_master.h" 3 | 4 | #ifdef RGBW 5 | # error "RGBW not supported" 6 | #endif 7 | 8 | #ifndef WS2812_ADDRESS 9 | # define WS2812_ADDRESS 0xb0 10 | #endif 11 | 12 | #ifndef WS2812_TIMEOUT 13 | # define WS2812_TIMEOUT 100 14 | #endif 15 | 16 | void ws2812_init(void) { i2c_init(); } 17 | 18 | // Setleds for standard RGB 19 | void ws2812_setleds(LED_TYPE *ledarray, uint16_t leds) { 20 | static bool s_init = false; 21 | if (!s_init) { 22 | ws2812_init(); 23 | s_init = true; 24 | } 25 | 26 | i2c_transmit(WS2812_ADDRESS, (uint8_t *)ledarray, sizeof(LED_TYPE) * leds, WS2812_TIMEOUT); 27 | } 28 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/cycle_out_in_dual_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL 2 | RGB_MATRIX_EFFECT(CYCLE_OUT_IN_DUAL) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | static HSV CYCLE_OUT_IN_DUAL_math(HSV hsv, int16_t dx, int16_t dy, uint8_t time) { 6 | dx = (k_rgb_matrix_center.x / 2) - abs8(dx); 7 | uint8_t dist = sqrt16(dx * dx + dy * dy); 8 | hsv.h = 3 * dist + time; 9 | return hsv; 10 | } 11 | 12 | bool CYCLE_OUT_IN_DUAL(effect_params_t* params) { return effect_runner_dx_dy(params, &CYCLE_OUT_IN_DUAL_math); } 13 | 14 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 15 | #endif // DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL 16 | -------------------------------------------------------------------------------- /util/travis_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}" 4 | TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}" 5 | 6 | NUM_CORE_CHANGES=$(echo "$QMK_CHANGES" | grep -Ecv -e '^(docs/)' -e '^(keyboards/)' -e '^(layouts/)' -e '^(util/)' -e '^(lib/python/)' -e '^(bin/qmk)' -e '^(requirements.txt)' -e '(.travis.yml)') 7 | 8 | if [[ "$TRAVIS_COMMIT_MESSAGE" == *"[skip test]"* ]]; then 9 | echo "Skipping due to commit message" 10 | exit 0 11 | fi 12 | 13 | if [ "$BRANCH" != "master" ] && [ "$NUM_IMPACTING_CHANGES" == "0" ]; then 14 | echo "Skipping due to changes not impacting tests" 15 | exit 0 16 | fi 17 | 18 | exit $exit_code 19 | -------------------------------------------------------------------------------- /common.mk: -------------------------------------------------------------------------------- 1 | include message.mk 2 | 3 | # Directory common source files exist 4 | TOP_DIR = . 5 | TMK_DIR = tmk_core 6 | TMK_PATH = $(TMK_DIR) 7 | LIB_PATH = lib 8 | 9 | QUANTUM_DIR = quantum 10 | QUANTUM_PATH = $(QUANTUM_DIR) 11 | 12 | DRIVER_DIR = drivers 13 | DRIVER_PATH = $(DRIVER_DIR) 14 | 15 | BUILD_DIR := .build 16 | 17 | COMMON_VPATH := $(TOP_DIR) 18 | COMMON_VPATH += $(TMK_PATH) 19 | COMMON_VPATH += $(QUANTUM_PATH) 20 | COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras 21 | COMMON_VPATH += $(QUANTUM_PATH)/audio 22 | COMMON_VPATH += $(QUANTUM_PATH)/process_keycode 23 | COMMON_VPATH += $(QUANTUM_PATH)/api 24 | COMMON_VPATH += $(QUANTUM_PATH)/sequencer 25 | COMMON_VPATH += $(DRIVER_PATH) 26 | -------------------------------------------------------------------------------- /lib/python/qmk/cli/json/keymap.py: -------------------------------------------------------------------------------- 1 | """Generate a keymap.c from a configurator export. 2 | """ 3 | from pathlib import Path 4 | 5 | from milc import cli 6 | 7 | 8 | @cli.argument('-o', '--output', arg_only=True, type=Path, help='File to write to') 9 | @cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages") 10 | @cli.argument('filename', arg_only=True, help='Configurator JSON file') 11 | @cli.subcommand('Creates a keymap.c from a QMK Configurator export.', hidden=True) 12 | def json_keymap(cli): 13 | """Renamed to `qmk json2c`. 14 | """ 15 | cli.log.error('This command has been renamed to `qmk json2c`.') 16 | return False 17 | -------------------------------------------------------------------------------- /tmk_core/common/debug.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "debug.h" 3 | 4 | #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) 5 | 6 | debug_config_t debug_config = { 7 | /* GCC Bug 10676 - Using unnamed fields in initializers 8 | * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676 */ 9 | #if GCC_VERSION >= 40600 10 | .enable = false, 11 | .matrix = false, 12 | .keyboard = false, 13 | .mouse = false, 14 | .reserved = 0 15 | #else 16 | { 17 | false, // .enable 18 | false, // .matrix 19 | false, // .keyboard 20 | false, // .mouse 21 | 0 // .reserved 22 | } 23 | #endif 24 | }; 25 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/solid_reactive_simple_anim.h: -------------------------------------------------------------------------------- 1 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED 2 | # ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE 3 | RGB_MATRIX_EFFECT(SOLID_REACTIVE_SIMPLE) 4 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 5 | 6 | static HSV SOLID_REACTIVE_SIMPLE_math(HSV hsv, uint16_t offset) { 7 | hsv.v = scale8(255 - offset, hsv.v); 8 | return hsv; 9 | } 10 | 11 | bool SOLID_REACTIVE_SIMPLE(effect_params_t* params) { return effect_runner_reactive(params, &SOLID_REACTIVE_SIMPLE_math); } 12 | 13 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 14 | # endif // DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE 15 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED 16 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS 2 | RGB_MATRIX_EFFECT(RAINBOW_PINWHEELS) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | static HSV RAINBOW_PINWHEELS_math(HSV hsv, int8_t sin, int8_t cos, uint8_t i, uint8_t time) { 6 | hsv.h += ((g_led_config.point[i].y - k_rgb_matrix_center.y) * 3 * cos + (56 - abs8(g_led_config.point[i].x - k_rgb_matrix_center.x)) * 3 * sin) / 128; 7 | return hsv; 8 | } 9 | 10 | bool RAINBOW_PINWHEELS(effect_params_t* params) { return effect_runner_sin_cos_i(params, &RAINBOW_PINWHEELS_math); } 11 | 12 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 13 | #endif // DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS 14 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/arduino-1.0.1/cores/arduino/new.h: -------------------------------------------------------------------------------- 1 | /* Header to define new/delete operators as they aren't provided by avr-gcc by default 2 | Taken from http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=59453 3 | */ 4 | 5 | #ifndef NEW_H 6 | #define NEW_H 7 | 8 | #include 9 | 10 | void * operator new(size_t size); 11 | void operator delete(void * ptr); 12 | 13 | __extension__ typedef int __guard __attribute__((mode (__DI__))); 14 | 15 | extern "C" int __cxa_guard_acquire(__guard *); 16 | extern "C" void __cxa_guard_release (__guard *); 17 | extern "C" void __cxa_guard_abort (__guard *); 18 | 19 | extern "C" void __cxa_pure_virtual(void); 20 | 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /util/install/slackware.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | _qmk_install_prepare() { 4 | echo "Before you continue, please ensure that your user is added to sudoers and that sboinstall is configured." 5 | read -p "Proceed? [y/N] " res 6 | 7 | case $res in 8 | [Yy]*) 9 | ;; 10 | *) 11 | return 1;; 12 | esac 13 | } 14 | 15 | _qmk_install() { 16 | echo "Installing dependencies" 17 | 18 | sudo sboinstall \ 19 | avr-binutils avr-gcc avr-libc \ 20 | arm-binutils arm-gcc newlib \ 21 | python3 \ 22 | avrdude dfu-programmer dfu-util teensy_loader_cli 23 | 24 | python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt 25 | } 26 | -------------------------------------------------------------------------------- /doxygen-todo: -------------------------------------------------------------------------------- 1 | tmk_core/protocol 2 | tmk_core/protocol/chibios 3 | tmk_core/protocol/lufa 4 | tmk_core/protocol/midi 5 | tmk_core/protocol/midi/bytequeue 6 | tmk_core/protocol/midi/Config 7 | tmk_core/protocol/usb_hid 8 | tmk_core/protocol/vusb 9 | tmk_core/tool 10 | tmk_core/tool/chibios 11 | quantum 12 | quantum/api 13 | quantum/audio 14 | quantum/keymap_extras 15 | quantum/process_keycode 16 | quantum/serial_link 17 | quantum/serial_link/protocol 18 | quantum/serial_link/system 19 | quantum/serial_link/tests 20 | quantum/tools 21 | quantum/visualizer 22 | quantum/visualizer/resources 23 | drivers 24 | drivers/avr 25 | drivers/ugfx 26 | drivers/ugfx/gdisp 27 | drivers/ugfx/gdisp/is31fl3731c 28 | drivers/ugfx/gdisp/st7565 29 | -------------------------------------------------------------------------------- /util/install/debian.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DEBIAN_FRONTEND=noninteractive 4 | DEBCONF_NONINTERACTIVE_SEEN=true 5 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 6 | 7 | _qmk_install_prepare() { 8 | sudo apt-get update 9 | } 10 | 11 | _qmk_install() { 12 | echo "Installing dependencies" 13 | 14 | sudo apt-get -yq install \ 15 | build-essential clang-format diffutils gcc git unzip wget zip \ 16 | python3-pip \ 17 | binutils-avr gcc-avr avr-libc \ 18 | binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi \ 19 | avrdude dfu-programmer dfu-util teensy-loader-cli libusb-dev 20 | 21 | python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt 22 | } 23 | -------------------------------------------------------------------------------- /tmk_core/protocol/arm_atsam/md_bootloader.h: -------------------------------------------------------------------------------- 1 | #ifndef _MD_BOOTLOADER_H_ 2 | #define _MD_BOOTLOADER_H_ 3 | 4 | extern uint32_t _srom; 5 | extern uint32_t _lrom; 6 | extern uint32_t _erom; 7 | 8 | #define BOOTLOADER_SERIAL_MAX_SIZE 20 // DO NOT MODIFY! 9 | 10 | #ifdef KEYBOARD_massdrop_ctrl 11 | // WARNING: These are only for CTRL bootloader release "v2.18Jun 22 2018 17:28:08" for bootloader_jump support 12 | extern uint32_t _eram; 13 | # define BOOTLOADER_MAGIC 0x3B9ACA00 14 | # define MAGIC_ADDR (uint32_t *)((intptr_t)(&_eram) - 4) 15 | #endif 16 | 17 | #ifdef MD_BOOTLOADER 18 | 19 | # define MCU_HZ 48000000 20 | # define I2C_HZ 0 // Not used 21 | 22 | #endif // MD_BOOTLOADER 23 | 24 | #endif //_MD_BOOTLOADER_H_ 25 | -------------------------------------------------------------------------------- /util/install/arch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | _qmk_install() { 4 | echo "Installing dependencies" 5 | 6 | sudo pacman --needed --noconfirm -S \ 7 | base-devel clang diffutils gcc git unzip wget zip \ 8 | python-pip \ 9 | avr-binutils \ 10 | arm-none-eabi-binutils arm-none-eabi-gcc arm-none-eabi-newlib \ 11 | avrdude dfu-programmer dfu-util 12 | sudo pacman --needed --noconfirm -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.3.0-1-x86_64.pkg.tar.xz 13 | sudo pacman --needed --noconfirm -S avr-libc # Must be installed after the above, or it will bring in the latest avr-gcc instead 14 | 15 | python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt 16 | } 17 | -------------------------------------------------------------------------------- /quantum/split_common/post_config.h: -------------------------------------------------------------------------------- 1 | #if defined(USE_I2C) || defined(EH) 2 | // When using I2C, using rgblight implicitly involves split support. 3 | # if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_SPLIT) 4 | # define RGBLIGHT_SPLIT 5 | # endif 6 | 7 | # ifndef F_SCL 8 | # define F_SCL 100000UL // SCL frequency 9 | # endif 10 | 11 | #else // use serial 12 | // When using serial, the user must define RGBLIGHT_SPLIT explicitly 13 | // in config.h as needed. 14 | // see quantum/rgblight_post_config.h 15 | # if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) 16 | // When using serial and RGBLIGHT_SPLIT need separate transaction 17 | # define SERIAL_USE_MULTI_TRANSACTION 18 | # endif 19 | #endif 20 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/chibios"] 2 | path = lib/chibios 3 | url = https://github.com/qmk/ChibiOS 4 | branch = master 5 | [submodule "lib/chibios-contrib"] 6 | path = lib/chibios-contrib 7 | url = https://github.com/qmk/ChibiOS-Contrib 8 | branch = master 9 | [submodule "lib/ugfx"] 10 | path = lib/ugfx 11 | url = https://github.com/qmk/uGFX 12 | branch = master 13 | [submodule "lib/googletest"] 14 | path = lib/googletest 15 | url = https://github.com/qmk/googletest 16 | [submodule "lib/lufa"] 17 | path = lib/lufa 18 | url = https://github.com/zsa/lufa 19 | [submodule "lib/vusb"] 20 | path = lib/vusb 21 | url = https://github.com/qmk/v-usb 22 | [submodule "lib/printf"] 23 | path = lib/printf 24 | url = https://github.com/qmk/printf 25 | -------------------------------------------------------------------------------- /tests/basic/rules.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Fred Sundvik 2 | # 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation, either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | CUSTOM_MATRIX=yes 17 | -------------------------------------------------------------------------------- /util/generate_internal_docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | if ! doxygen -v 2>&1 > /dev/null; then 6 | echo "doxygen not found! Please install it!" 7 | exit 1 8 | elif ! moxygen -V 2>&1 > /dev/null; then 9 | echo -n "moxygen not found! Would you like to install it? [y/n] " 10 | read ANSWER 11 | case $ANSWER in 12 | y|Y|yes|YES|Yes) 13 | npm install -g moxygen 14 | ;; 15 | *) 16 | exit 1 17 | ;; 18 | esac 19 | fi 20 | 21 | if [ ! -e Doxyfile ]; then 22 | echo "Error: You must run this from the top-level qmk_firmware directory!" 23 | exit 1 24 | fi 25 | 26 | # Generate the doxygen XML files 27 | rm -rf doxygen 28 | doxygen Doxyfile 29 | 30 | # Generate the moxygen Markdown files 31 | moxygen -a -g -o docs/internals_%s.md doxygen/xml 32 | -------------------------------------------------------------------------------- /tmk_core/common/test/suspend.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Fred Sundvik 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | -------------------------------------------------------------------------------- /keyboards/ergodox_ez/190hotfix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #a tool to fix broken keymaps as a result of pull request #190 3 | #changing the declaration of matrix_scan_user() and matrix_init_user() 4 | # 5 | #This script will save a copy of the specified keymap as keymap.c.bak 6 | #and then create a new keymap.c with the definion corrected. 7 | #this script must be run from the ergodox_ez directory 8 | if [ $# -ne 1 ]; then 9 | echo $0: usage: ./190hotfix keymap_name 10 | exit 1 11 | fi 12 | 13 | echo Saving backup as ./keymaps/$1/keymap.c.bak ... 14 | mv ./keymaps/$1/keymap.c ./keymaps/$1/keymap.c.bak 15 | 16 | echo Modifying ./keymaps/$1/keymap.c ... 17 | cat ./keymaps/$1/keymap.c.bak | sed -r 's/^void \* matrix_/void matrix_/'>./keymaps/$1/keymap.c 18 | 19 | echo Complete! 20 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: Google 3 | AlignAfterOpenBracket: Align 4 | AlignConsecutiveAssignments: 'true' 5 | AlignConsecutiveDeclarations: 'true' 6 | AlignOperands: 'true' 7 | AllowAllParametersOfDeclarationOnNextLine: 'false' 8 | AlwaysBreakAfterDefinitionReturnType: None 9 | AlwaysBreakAfterReturnType: None 10 | AlwaysBreakBeforeMultilineStrings: 'false' 11 | BinPackArguments: 'true' 12 | BinPackParameters: 'true' 13 | ColumnLimit: '1000' 14 | IndentCaseLabels: 'true' 15 | IndentPPDirectives: AfterHash 16 | IndentWidth: '4' 17 | MaxEmptyLinesToKeep: '1' 18 | PointerAlignment: Right 19 | SortIncludes: 'false' 20 | SpaceBeforeAssignmentOperators: 'true' 21 | SpaceBeforeParens: ControlStatements 22 | SpaceInEmptyParentheses: 'false' 23 | TabWidth: '4' 24 | UseTab: Never 25 | 26 | ... 27 | -------------------------------------------------------------------------------- /lib/python/qmk/cli/list/keymaps.py: -------------------------------------------------------------------------------- 1 | """List the keymaps for a specific keyboard 2 | """ 3 | from milc import cli 4 | 5 | import qmk.keymap 6 | from qmk.decorators import automagic_keyboard 7 | from qmk.path import is_keyboard 8 | 9 | 10 | @cli.argument("-kb", "--keyboard", help="Specify keyboard name. Example: 1upkeyboards/1up60hse") 11 | @cli.subcommand("List the keymaps for a specific keyboard") 12 | @automagic_keyboard 13 | def list_keymaps(cli): 14 | """List the keymaps for a specific keyboard 15 | """ 16 | if not is_keyboard(cli.config.list_keymaps.keyboard): 17 | cli.log.error('Keyboard %s does not exist!', cli.config.list_keymaps.keyboard) 18 | return False 19 | 20 | for name in qmk.keymap.list_keymaps(cli.config.list_keymaps.keyboard): 21 | print(name) 22 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_runners/effect_runner_sin_cos_i.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef HSV (*sin_cos_i_f)(HSV hsv, int8_t sin, int8_t cos, uint8_t i, uint8_t time); 4 | 5 | bool effect_runner_sin_cos_i(effect_params_t* params, sin_cos_i_f effect_func) { 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); 7 | 8 | uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 4); 9 | int8_t cos_value = cos8(time) - 128; 10 | int8_t sin_value = sin8(time) - 128; 11 | for (uint8_t i = led_min; i < led_max; i++) { 12 | RGB_MATRIX_TEST_LED_FLAGS(); 13 | RGB rgb = rgb_matrix_hsv_to_rgb(effect_func(rgb_matrix_config.hsv, cos_value, sin_value, i, time)); 14 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); 15 | } 16 | return led_max < DRIVER_LED_TOTAL; 17 | } 18 | -------------------------------------------------------------------------------- /quantum/template/base/keyboard.c: -------------------------------------------------------------------------------- 1 | /* Copyright %YEAR% %YOUR_NAME% 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #include "%KEYBOARD%.h" 18 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_runners/effect_runner_dx_dy.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef HSV (*dx_dy_f)(HSV hsv, int16_t dx, int16_t dy, uint8_t time); 4 | 5 | bool effect_runner_dx_dy(effect_params_t* params, dx_dy_f effect_func) { 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); 7 | 8 | uint8_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 2); 9 | for (uint8_t i = led_min; i < led_max; i++) { 10 | RGB_MATRIX_TEST_LED_FLAGS(); 11 | int16_t dx = g_led_config.point[i].x - k_rgb_matrix_center.x; 12 | int16_t dy = g_led_config.point[i].y - k_rgb_matrix_center.y; 13 | RGB rgb = rgb_matrix_hsv_to_rgb(effect_func(rgb_matrix_config.hsv, dx, dy, time)); 14 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); 15 | } 16 | return led_max < DRIVER_LED_TOTAL; 17 | } 18 | -------------------------------------------------------------------------------- /util/travis_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # if docker is installed - call make within the qmk docker image 4 | if command -v docker >/dev/null; then 5 | function make() { 6 | docker run --rm -e MAKEFLAGS="$MAKEFLAGS" -w /qmk_firmware/ -v "$PWD":/qmk_firmware --user $(id -u):$(id -g) qmkfm/base_container make "$@" 7 | } 8 | fi 9 | 10 | # test force push 11 | #TRAVIS_COMMIT_RANGE="c287f1bfc5c8...81f62atc4c1d" 12 | 13 | TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}" 14 | TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}" 15 | MAKE_ALL="make all:all" 16 | 17 | if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then 18 | exit_code=0 19 | echo "Making all keymaps for all of the ZSA keyboards" 20 | eval $MAKE_ALL 21 | : $((exit_code = $exit_code + $?)) 22 | exit $exit_code 23 | fi 24 | -------------------------------------------------------------------------------- /keyboards/ergodox_ez/keymaps/default/readme.md: -------------------------------------------------------------------------------- 1 | # ErgoDox EZ Default Configuration 2 | 3 | ## Changelog 4 | 5 | * Dec 2016: 6 | * Added LED keys 7 | * Refreshed layout graphic, comes from http://configure.ergodox-ez.com now. 8 | * Sep 22, 2016: 9 | * Created a new key in layer 1 (bottom-corner key) that resets the EEPROM. 10 | * Feb 2, 2016 (V1.1): 11 | * Made the right-hand quote key double as Cmd/Win on hold. So you get ' when you tap it, " when you tap it with Shift, and Cmd or Win when you hold it. You can then use it as a modifier, or just press and hold it for a moment (and then let go) to send a single Cmd or Win keystroke (handy for opening the Start menu on Windows). 12 | 13 | This is what we ship with out of the factory. :) The image says it all: 14 | 15 | ![Default](https://i.imgur.com/Be53jH7.png) -------------------------------------------------------------------------------- /keyboards/ergodox_ez/keymaps/webusb/readme.md: -------------------------------------------------------------------------------- 1 | # ErgoDox EZ Default Configuration 2 | 3 | ## Changelog 4 | 5 | * Dec 2016: 6 | * Added LED keys 7 | * Refreshed layout graphic, comes from http://configure.ergodox-ez.com now. 8 | * Sep 22, 2016: 9 | * Created a new key in layer 1 (bottom-corner key) that resets the EEPROM. 10 | * Feb 2, 2016 (V1.1): 11 | * Made the right-hand quote key double as Cmd/Win on hold. So you get ' when you tap it, " when you tap it with Shift, and Cmd or Win when you hold it. You can then use it as a modifier, or just press and hold it for a moment (and then let go) to send a single Cmd or Win keystroke (handy for opening the Start menu on Windows). 12 | 13 | This is what we ship with out of the factory. :) The image says it all: 14 | 15 | ![Default](https://i.imgur.com/Be53jH7.png) -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/override_Serial.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Null implementation of Serial to dump debug print into blackhole 3 | */ 4 | #include "Arduino.h" 5 | #include "sendchar.h" 6 | 7 | #include "USBAPI.h" 8 | 9 | 10 | void Serial_::begin(uint16_t baud_count) 11 | { 12 | } 13 | 14 | void Serial_::end(void) 15 | { 16 | } 17 | 18 | void Serial_::accept(void) 19 | { 20 | } 21 | 22 | int Serial_::available(void) 23 | { 24 | return 0; 25 | } 26 | 27 | int Serial_::peek(void) 28 | { 29 | return -1; 30 | } 31 | 32 | int Serial_::read(void) 33 | { 34 | return -1; 35 | } 36 | 37 | void Serial_::flush(void) 38 | { 39 | } 40 | 41 | size_t Serial_::write(uint8_t c) 42 | { 43 | sendchar(c); 44 | return 1; 45 | } 46 | 47 | Serial_::operator bool() { 48 | return true; 49 | } 50 | 51 | Serial_ Serial; 52 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/breathing_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_BREATHING 2 | RGB_MATRIX_EFFECT(BREATHING) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | bool BREATHING(effect_params_t* params) { 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); 7 | 8 | HSV hsv = rgb_matrix_config.hsv; 9 | uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); 10 | hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); 11 | RGB rgb = rgb_matrix_hsv_to_rgb(hsv); 12 | for (uint8_t i = led_min; i < led_max; i++) { 13 | RGB_MATRIX_TEST_LED_FLAGS(); 14 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); 15 | } 16 | return led_max < DRIVER_LED_TOTAL; 17 | } 18 | 19 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 20 | #endif // DISABLE_RGB_MATRIX_BREATHING 21 | -------------------------------------------------------------------------------- /keyboards/planck/ez/rules.mk: -------------------------------------------------------------------------------- 1 | # MCU name 2 | MCU = STM32F303 3 | 4 | # Build Options 5 | # comment out to disable the options. 6 | # 7 | BACKLIGHT_ENABLE = no 8 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration 9 | ## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) 10 | MOUSEKEY_ENABLE = yes # Mouse keys 11 | EXTRAKEY_ENABLE = yes # Audio control and System control 12 | CONSOLE_ENABLE = no # Console for debug 13 | COMMAND_ENABLE = no # Commands for debug and configuration 14 | #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend 15 | NKRO_ENABLE = yes # USB Nkey Rollover 16 | AUDIO_ENABLE = yes 17 | RGBLIGHT_ENABLE = no 18 | # SERIAL_LINK_ENABLE = yes 19 | ENCODER_ENABLE = yes 20 | RGB_MATRIX_DRIVER = IS31FL3737 21 | 22 | LAYOUTS += ortho_4x12 23 | 24 | MOUSE_SHARED_EP = no 25 | -------------------------------------------------------------------------------- /tests/basic/config.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Fred Sundvik 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | #define MATRIX_ROWS 4 20 | #define MATRIX_COLS 10 21 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/library.properties: -------------------------------------------------------------------------------- 1 | name=USB Host Shield Library 2.0 2 | version=1.1.0 3 | author=Oleg Mazurov (Circuits@Home) , Kristian Lauszus (TKJ Electronics) , Andrew Kroll , Alexei Glushchenko (Circuits@Home) 4 | maintainer=Oleg Mazurov (Circuits@Home) , Kristian Lauszus (TKJ Electronics) , Andrew Kroll 5 | sentence=Revision 2.0 of MAX3421E-based USB Host Shield Library. 6 | paragraph=Supports HID devices, FTDI, ADK, ACM, PL2303, Bluetooth HID devices, SPP communication and mass storage devices. Furthermore it supports PS3, PS4, PS Buzz, Wii and Xbox controllers. 7 | category=Other 8 | url=https://github.com/felis/USB_Host_Shield_2.0 9 | architectures=* -------------------------------------------------------------------------------- /util/macos_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | util_dir=$(dirname "$0") 4 | 5 | if ! brew --version 2>&1 > /dev/null; then 6 | echo "Error! Homebrew not installed or broken!" 7 | echo -n "Would you like to install homebrew now? [y/n] " 8 | while read ANSWER; do 9 | case $ANSWER in 10 | y|Y) 11 | /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 12 | break 13 | ;; 14 | n|N) 15 | exit 1 16 | ;; 17 | *) 18 | echo -n "Would you like to install homebrew now? [y/n] " 19 | ;; 20 | esac 21 | done 22 | fi 23 | 24 | # All macOS dependencies are managed in the homebrew package: 25 | # https://github.com/qmk/homebrew-qmk 26 | brew update 27 | brew install qmk/qmk/qmk 28 | brew link --force avr-gcc@8 29 | 30 | pip3 install -r "${util_dir}/../requirements.txt" 31 | -------------------------------------------------------------------------------- /quantum/template/ps2avrgb/rules.mk: -------------------------------------------------------------------------------- 1 | # MCU name 2 | MCU = atmega32a 3 | 4 | # Bootloader selection 5 | BOOTLOADER = bootloadHID 6 | 7 | # Build Options 8 | # change yes to no to disable 9 | # 10 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration 11 | MOUSEKEY_ENABLE = yes # Mouse keys 12 | EXTRAKEY_ENABLE = yes # Audio control and System control 13 | CONSOLE_ENABLE = no # Console for debug 14 | COMMAND_ENABLE = no # Commands for debug and configuration 15 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 16 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend 17 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality 18 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow 19 | WS2812_DRIVER = i2c 20 | 21 | OPT_DEFS = -DDEBUG_LEVEL=0 22 | -------------------------------------------------------------------------------- /tmk_core/common/test/bootloader.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Fred Sundvik 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #include "bootloader.h" 18 | 19 | void bootloader_jump(void) {} 20 | -------------------------------------------------------------------------------- /util/install/macos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | _qmk_install_prepare() { 4 | echo "Checking Homebrew installation" 5 | 6 | if ! brew --version >/dev/null 2>&1; then 7 | echo "Error! Homebrew is broken or not installed." 8 | echo "Please run \`brew doctor\` or follow the installation instructions at https://brew.sh/, then re-run this script." 9 | return 1 10 | fi 11 | 12 | brew update && brew upgrade --ignore-pinned 13 | } 14 | 15 | _qmk_install() { 16 | echo "Installing dependencies" 17 | 18 | # All macOS dependencies are managed in the Homebrew package: 19 | # https://github.com/qmk/homebrew-qmk 20 | brew install qmk/qmk/qmk 21 | 22 | brew link --force avr-gcc@8 23 | brew link --force arm-gcc-bin@8 24 | 25 | python3 -m pip install -r $QMK_FIRMWARE_DIR/requirements.txt 26 | } 27 | -------------------------------------------------------------------------------- /quantum/template/avr/readme.md: -------------------------------------------------------------------------------- 1 | # %KEYBOARD% 2 | 3 | ![%KEYBOARD%](imgur.com image replace me!) 4 | 5 | *A short description of the keyboard/project* 6 | 7 | * Keyboard Maintainer: [%YOUR_NAME%](https://github.com/yourusername) 8 | * Hardware Supported: *The PCBs, controllers supported* 9 | * Hardware Availability: *Links to where you can find this hardware* 10 | 11 | Make example for this keyboard (after setting up your build environment): 12 | 13 | make %KEYBOARD%:default 14 | 15 | Flashing example for this keyboard: 16 | 17 | make %KEYBOARD%:default:flash 18 | 19 | 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). 20 | -------------------------------------------------------------------------------- /tmk_core/common/sendchar_null.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | #include "sendchar.h" 18 | 19 | __attribute__((weak)) int8_t sendchar(uint8_t c) { return 0; } 20 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/arduino-1.0.1/cores/arduino/Client.h: -------------------------------------------------------------------------------- 1 | #ifndef client_h 2 | #define client_h 3 | #include "Print.h" 4 | #include "Stream.h" 5 | #include "IPAddress.h" 6 | 7 | class Client : public Stream { 8 | 9 | public: 10 | virtual int connect(IPAddress ip, uint16_t port) =0; 11 | virtual int connect(const char *host, uint16_t port) =0; 12 | virtual size_t write(uint8_t) =0; 13 | virtual size_t write(const uint8_t *buf, size_t size) =0; 14 | virtual int available() = 0; 15 | virtual int read() = 0; 16 | virtual int read(uint8_t *buf, size_t size) = 0; 17 | virtual int peek() = 0; 18 | virtual void flush() = 0; 19 | virtual void stop() = 0; 20 | virtual uint8_t connected() = 0; 21 | virtual operator bool() = 0; 22 | protected: 23 | uint8_t* rawIPAddress(IPAddress& addr) { return addr.raw_address(); }; 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /tmk_core/common/bootloader.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #pragma once 19 | 20 | /* give code for your bootloader to come up if needed */ 21 | void bootloader_jump(void); 22 | -------------------------------------------------------------------------------- /util/drivers.txt: -------------------------------------------------------------------------------- 1 | # The format is 2 | # driver,desc,vid,pid,guid 3 | # Use a comma as a separator without spaces 4 | # Driver can be one of winusb,libusb,libusbk 5 | # Use Windows Powershell and type [guid]::NewGuid() to generate guids 6 | winusb,STM32 Bootloader,0483,DF11,6d98a87f-4ecf-464d-89ed-8c684d857a75 7 | libusbk,USBaspLoader,16C0,05DC,e69affdc-0ef0-427c-aefb-4e593c9d2724 8 | winusb,Kiibohd DFU Bootloader,1C11,B007,aa5a3f86-b81e-4416-89ad-0c1ea1ed63af 9 | libusb,ATmega16U2,03EB,2FEF,007274da-b75f-492e-a288-8fc0aff8339f 10 | libusb,ATmega32U2,03EB,2FF0,ddc2c572-cb6e-4f61-a6cc-1a5de941f063 11 | libusb,ATmega16U4,03EB,2FF3,3180d426-bf93-4578-a693-2efbc337da8e 12 | libusb,ATmega32U4,03EB,2FF4,5f9726fd-f9de-487a-9fbd-8b3524a7a56a 13 | libusb,AT90USB64,03EB,2FF9,c6a708ad-e97d-43cd-b04a-3180d737a71b 14 | libusb,AT90USB128,03EB,2FFB,fd217df3-59d0-440a-a8f3-4c0c8c84daa3 15 | -------------------------------------------------------------------------------- /quantum/process_keycode/process_magic.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | #pragma once 17 | 18 | #include "quantum.h" 19 | 20 | bool process_magic(uint16_t keycode, keyrecord_t *record); 21 | -------------------------------------------------------------------------------- /quantum/led_tables.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017 Fred Sundvik 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License 13 | along with this program. If not, see . 14 | */ 15 | 16 | #pragma once 17 | 18 | #include "progmem.h" 19 | #include 20 | 21 | #ifdef USE_CIE1931_CURVE 22 | extern const uint8_t CIE1931_CURVE[] PROGMEM; 23 | #endif 24 | -------------------------------------------------------------------------------- /quantum/process_keycode/process_grave_esc.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | #pragma once 17 | 18 | #include "quantum.h" 19 | 20 | bool process_grave_esc(uint16_t keycode, keyrecord_t *record); 21 | -------------------------------------------------------------------------------- /quantum/process_keycode/process_rgb.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | #pragma once 17 | 18 | #include "quantum.h" 19 | 20 | bool process_rgb(const uint16_t keycode, const keyrecord_t *record); 21 | -------------------------------------------------------------------------------- /tmk_core/common/sendchar_uart.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | #include "uart.h" 18 | #include "sendchar.h" 19 | 20 | int8_t sendchar(uint8_t c) { 21 | uart_putchar(c); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /platforms/chibios/BLACKPILL_STM32_F401/configs/board.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Nick Brassel (tzarc) 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 3 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | #pragma once 17 | 18 | #include_next "board.h" 19 | 20 | #undef STM32_HSE_BYPASS 21 | -------------------------------------------------------------------------------- /platforms/chibios/BLACKPILL_STM32_F411/configs/board.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Nick Brassel (tzarc) 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 3 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | #pragma once 17 | 18 | #include_next "board.h" 19 | 20 | #undef STM32_HSE_BYPASS 21 | -------------------------------------------------------------------------------- /platforms/chibios/GENERIC_STM32_F072XB/configs/board.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Nick Brassel (tzarc) 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 3 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | #pragma once 17 | 18 | #include_next "board.h" 19 | 20 | #undef STM32_HSE_BYPASS 21 | -------------------------------------------------------------------------------- /platforms/chibios/keyboard-config-templates/board.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Nick Brassel (tzarc) 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 3 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | #pragma once 17 | 18 | #include_next 19 | 20 | // #undef STM32_HSE_BYPASS 21 | -------------------------------------------------------------------------------- /quantum/process_keycode/process_backlight.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "quantum.h" 20 | 21 | bool process_backlight(uint16_t keycode, keyrecord_t *record); 22 | -------------------------------------------------------------------------------- /quantum/process_keycode/process_terminal_nop.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Jack Humbert 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "quantum.h" 20 | 21 | #define TERM_ON KC_NO 22 | #define TERM_OFF KC_NO 23 | -------------------------------------------------------------------------------- /tmk_core/protocol/arm_atsam/main_arm_atsam.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Massdrop Inc. 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef _MAIN_ARM_ATSAM_H_ 19 | #define _MAIN_ARM_ATSAM_H_ 20 | 21 | uint8_t keyboard_leds(void); 22 | 23 | #endif //_MAIN_ARM_ATSAM_H_ 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest a new feature or changes to existing features 4 | --- 5 | 6 | 7 | 8 | 9 | 10 | ## Feature Request Type 11 | 12 | - [ ] Core functionality 13 | - [ ] Add-on hardware support (eg. audio, RGB, OLED screen, etc.) 14 | - [ ] Alteration (enhancement/optimization) of existing feature(s) 15 | - [ ] New behavior 16 | 17 | ## Description 18 | 19 | 20 | -------------------------------------------------------------------------------- /keyboards/moonlander/rules.mk: -------------------------------------------------------------------------------- 1 | #Cortex version 2 | MCU = STM32F303 3 | 4 | #Build Options 5 | #comment out to disable the options. 6 | # 7 | BACKLIGHT_ENABLE = no 8 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration 9 | MOUSEKEY_ENABLE = yes # Mouse keys 10 | EXTRAKEY_ENABLE = yes # Audio control and System control 11 | CONSOLE_ENABLE = no # Console for debug 12 | COMMAND_ENABLE = yes # Commands for debug and configuration 13 | #SLEEP_LED_ENABLE = yes #Breathing sleep LED during USB suspend 14 | NKRO_ENABLE = yes # USB Nkey Rollover 15 | CUSTOM_MATRIX = yes # Custom matrix file 16 | AUDIO_ENABLE = yes 17 | SWAP_HANDS_ENABLE = no 18 | RGB_MATRIX_ENABLE = yes 19 | RGB_MATRIX_DRIVER = IS31FL3731 20 | #SERIAL_LINK_ENABLE = yes 21 | EEPROM_DRIVER = i2c 22 | 23 | #project specific files 24 | SRC = matrix.c 25 | QUANTUM_LIB_SRC += i2c_master.c 26 | 27 | MOUSE_SHARED_EP = no 28 | -------------------------------------------------------------------------------- /platforms/chibios/keyboard-config-templates/halconf.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Nick Brassel (tzarc) 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 3 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | #pragma once 17 | 18 | // #define HAL_USE_DAC TRUE 19 | 20 | #include_next 21 | -------------------------------------------------------------------------------- /quantum/serial_link/tests/rules.mk: -------------------------------------------------------------------------------- 1 | serial_link_byte_stuffer_SRC :=\ 2 | $(SERIAL_PATH)/tests/byte_stuffer_tests.cpp \ 3 | $(SERIAL_PATH)/protocol/byte_stuffer.c 4 | 5 | serial_link_frame_validator_SRC := \ 6 | $(SERIAL_PATH)/tests/frame_validator_tests.cpp \ 7 | $(SERIAL_PATH)/protocol/frame_validator.c 8 | 9 | serial_link_frame_router_SRC := \ 10 | $(SERIAL_PATH)/tests/frame_router_tests.cpp \ 11 | $(SERIAL_PATH)/protocol/byte_stuffer.c \ 12 | $(SERIAL_PATH)/protocol/frame_validator.c \ 13 | $(SERIAL_PATH)/protocol/frame_router.c 14 | 15 | serial_link_triple_buffered_object_SRC := \ 16 | $(SERIAL_PATH)/tests/triple_buffered_object_tests.cpp \ 17 | $(SERIAL_PATH)/protocol/triple_buffered_object.c 18 | 19 | serial_link_transport_SRC := \ 20 | $(SERIAL_PATH)/tests/transport_tests.cpp \ 21 | $(SERIAL_PATH)/protocol/transport.c \ 22 | $(SERIAL_PATH)/protocol/triple_buffered_object.c 23 | -------------------------------------------------------------------------------- /drivers/eeprom/eeprom_driver.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 Nick Brassel (tzarc) 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "eeprom.h" 20 | 21 | void eeprom_driver_init(void); 22 | void eeprom_driver_erase(void); 23 | -------------------------------------------------------------------------------- /platforms/chibios/keyboard-config-templates/chconf.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Nick Brassel (tzarc) 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 3 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | #pragma once 17 | 18 | // #define CH_CFG_OPTIMIZE_SPEED TRUE 19 | 20 | #include_next 21 | -------------------------------------------------------------------------------- /quantum/process_keycode/process_key_lock.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Fredric Silberberg 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "quantum.h" 20 | 21 | bool process_key_lock(uint16_t *keycode, keyrecord_t *record); 22 | -------------------------------------------------------------------------------- /quantum/process_keycode/process_sequencer.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Rodolphe Belouin 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "quantum.h" 20 | 21 | bool process_sequencer(uint16_t keycode, keyrecord_t *record); 22 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_runners/effect_runner_dx_dy_dist.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef HSV (*dx_dy_dist_f)(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint8_t time); 4 | 5 | bool effect_runner_dx_dy_dist(effect_params_t* params, dx_dy_dist_f effect_func) { 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); 7 | 8 | uint8_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 2); 9 | for (uint8_t i = led_min; i < led_max; i++) { 10 | RGB_MATRIX_TEST_LED_FLAGS(); 11 | int16_t dx = g_led_config.point[i].x - k_rgb_matrix_center.x; 12 | int16_t dy = g_led_config.point[i].y - k_rgb_matrix_center.y; 13 | uint8_t dist = sqrt16(dx * dx + dy * dy); 14 | RGB rgb = rgb_matrix_hsv_to_rgb(effect_func(rgb_matrix_config.hsv, dx, dy, dist, time)); 15 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); 16 | } 17 | return led_max < DRIVER_LED_TOTAL; 18 | } 19 | -------------------------------------------------------------------------------- /quantum/visualizer/resources/resources.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Fred Sundvik 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | #ifdef LCD_ENABLE 22 | extern const uint8_t resource_lcd_logo[]; 23 | #endif 24 | -------------------------------------------------------------------------------- /lib/python/qmk/cli/__init__.py: -------------------------------------------------------------------------------- 1 | """QMK CLI Subcommands 2 | 3 | We list each subcommand here explicitly because all the reliable ways of searching for modules are slow and delay startup. 4 | """ 5 | import sys 6 | 7 | from milc import cli 8 | 9 | from . import c2json 10 | from . import cformat 11 | from . import chibios 12 | from . import clean 13 | from . import compile 14 | from . import config 15 | from . import docs 16 | from . import doctor 17 | from . import flash 18 | from . import generate 19 | from . import hello 20 | from . import info 21 | from . import json 22 | from . import json2c 23 | from . import lint 24 | from . import list 25 | from . import kle2json 26 | from . import new 27 | from . import pyformat 28 | from . import pytest 29 | 30 | if sys.version_info[0] != 3 or sys.version_info[1] < 6: 31 | cli.log.error('Your Python is too old! Please upgrade to Python 3.6 or later.') 32 | exit(127) 33 | -------------------------------------------------------------------------------- /quantum/process_keycode/process_unicode.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Jack Humbert 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "process_unicode_common.h" 20 | 21 | bool process_unicode(uint16_t keycode, keyrecord_t *record); 22 | -------------------------------------------------------------------------------- /tmk_core/common/nodebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #pragma once 19 | 20 | #ifndef NO_DEBUG 21 | # define NO_DEBUG 22 | # include "debug.h" 23 | # undef NO_DEBUG 24 | #else 25 | # include "debug.h" 26 | #endif 27 | -------------------------------------------------------------------------------- /tmk_core/common/avr/suspend_avr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | // clang-format off 10 | #define wdt_intr_enable(value) \ 11 | __asm__ __volatile__ ( \ 12 | "in __tmp_reg__,__SREG__" "\n\t" \ 13 | "cli" "\n\t" \ 14 | "wdr" "\n\t" \ 15 | "sts %0,%1" "\n\t" \ 16 | "out __SREG__,__tmp_reg__" "\n\t" \ 17 | "sts %0,%2" "\n\t" \ 18 | : /* no outputs */ \ 19 | : "M" (_SFR_MEM_ADDR(_WD_CONTROL_REG)), \ 20 | "r" (_BV(_WD_CHANGE_BIT) | _BV(WDE)), \ 21 | "r" ((uint8_t) ((value & 0x08 ? _WD_PS3_MASK : 0x00) | \ 22 | _BV(WDIE) | (value & 0x07)) ) \ 23 | : "r0" \ 24 | ) 25 | // clang-format on 26 | -------------------------------------------------------------------------------- /platforms/chibios/keyboard-config-templates/mcuconf.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Nick Brassel (tzarc) 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 3 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | #pragma once 17 | 18 | #include_next 19 | 20 | // #undef STM32_HSE_ENABLED 21 | // #define STM32_HSE_ENABLED FALSE 22 | -------------------------------------------------------------------------------- /lib/python/qmk/cli/docs.py: -------------------------------------------------------------------------------- 1 | """Serve QMK documentation locally 2 | """ 3 | import http.server 4 | import os 5 | 6 | from milc import cli 7 | 8 | 9 | @cli.argument('-p', '--port', default=8936, type=int, help='Port number to use.') 10 | @cli.subcommand('Run a local webserver for QMK documentation.', hidden=False if cli.config.user.developer else True) 11 | def docs(cli): 12 | """Spin up a local HTTPServer instance for the QMK docs. 13 | """ 14 | os.chdir('docs') 15 | 16 | with http.server.HTTPServer(('', cli.config.docs.port), http.server.SimpleHTTPRequestHandler) as httpd: 17 | cli.log.info("Serving QMK docs at http://localhost:%d/", cli.config.docs.port) 18 | cli.log.info("Press Control+C to exit.") 19 | 20 | try: 21 | httpd.serve_forever() 22 | except KeyboardInterrupt: 23 | cli.log.info("Stopping HTTP server...") 24 | finally: 25 | httpd.shutdown() 26 | -------------------------------------------------------------------------------- /quantum/process_keycode/process_printer.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Jack Humbert 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "quantum.h" 20 | 21 | #include "protocol/serial.h" 22 | 23 | bool process_printer(uint16_t keycode, keyrecord_t *record); 24 | -------------------------------------------------------------------------------- /keyboards/planck/ez/glow/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Jack Humbert 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #pragma once 19 | 20 | #undef PRODUCT_ID 21 | #define PRODUCT_ID 0xC6CF 22 | 23 | #undef PRODUCT 24 | #define PRODUCT Planck EZ Glow 25 | -------------------------------------------------------------------------------- /platforms/chibios/GENERIC_STM32_F042X6/configs/config.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Nick Brassel (tzarc) 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 3 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | #pragma once 17 | 18 | #ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP 19 | # define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE 20 | #endif 21 | -------------------------------------------------------------------------------- /platforms/chibios/GENERIC_STM32_F072XB/configs/config.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Nick Brassel (tzarc) 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 3 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | #pragma once 17 | 18 | #ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP 19 | # define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE 20 | #endif 21 | -------------------------------------------------------------------------------- /platforms/chibios/GENERIC_STM32_F303XC/configs/config.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Nick Brassel (tzarc) 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 3 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | #pragma once 17 | 18 | #ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP 19 | # define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE 20 | #endif 21 | -------------------------------------------------------------------------------- /keyboards/ergodox_ez/glow/glow.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 Jun Wako 3 | Copyright 2013 Oleg Kostyuk 4 | Copyright 2015 ZSA Technology Labs Inc (@zsa) 5 | Copyright 2020 Christopher Courtney (@drashna) 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 2 of the License, or 9 | (at your option) any later version. 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #pragma once 19 | 20 | #include "ergodox_ez.h" 21 | -------------------------------------------------------------------------------- /keyboards/ergodox_ez/shine/shine.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 Jun Wako 3 | Copyright 2013 Oleg Kostyuk 4 | Copyright 2015 ZSA Technology Labs Inc (@zsa) 5 | Copyright 2020 Christopher Courtney (@drashna) 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 2 of the License, or 9 | (at your option) any later version. 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #pragma once 19 | 20 | #include "ergodox_ez.h" 21 | -------------------------------------------------------------------------------- /lib/python/qmk/converter.py: -------------------------------------------------------------------------------- 1 | """Functions to convert to and from QMK formats 2 | """ 3 | from collections import OrderedDict 4 | 5 | 6 | def kle2qmk(kle): 7 | """Convert a KLE layout to QMK's layout format. 8 | """ 9 | layout = [] 10 | 11 | for row in kle: 12 | for key in row: 13 | if key['decal']: 14 | continue 15 | 16 | qmk_key = OrderedDict( 17 | label="", 18 | x=key['column'], 19 | y=key['row'], 20 | ) 21 | 22 | if key['width'] != 1: 23 | qmk_key['w'] = key['width'] 24 | if key['height'] != 1: 25 | qmk_key['h'] = key['height'] 26 | if 'name' in key and key['name']: 27 | qmk_key['label'] = key['name'].split('\n', 1)[0] 28 | else: 29 | del (qmk_key['label']) 30 | 31 | layout.append(qmk_key) 32 | 33 | return layout 34 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/gradient_up_down_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN 2 | RGB_MATRIX_EFFECT(GRADIENT_UP_DOWN) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | bool GRADIENT_UP_DOWN(effect_params_t* params) { 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); 7 | 8 | HSV hsv = rgb_matrix_config.hsv; 9 | uint8_t scale = scale8(64, rgb_matrix_config.speed); 10 | for (uint8_t i = led_min; i < led_max; i++) { 11 | RGB_MATRIX_TEST_LED_FLAGS(); 12 | // The y range will be 0..64, map this to 0..4 13 | // Relies on hue being 8-bit and wrapping 14 | hsv.h = rgb_matrix_config.hsv.h + scale * (g_led_config.point[i].y >> 4); 15 | RGB rgb = rgb_matrix_hsv_to_rgb(hsv); 16 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); 17 | } 18 | return led_max < DRIVER_LED_TOTAL; 19 | } 20 | 21 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 22 | #endif // DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN 23 | -------------------------------------------------------------------------------- /tmk_core/common/avr/bootloader_size.c: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Jack Humbert 2 | // 3 | // This program is free software: you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation, either version 2 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // This program is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with this program. If not, see . 15 | 16 | #include 17 | #include 18 | 19 | // clang-format off 20 | // this is not valid C - it's for computing the size available on the chip 21 | AVR_SIZE: FLASHEND + 1 - BOOTLOADER_SIZE 22 | -------------------------------------------------------------------------------- /tmk_core/common/eeprom.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(__AVR__) && !defined(EEPROM_DRIVER) 4 | # include 5 | #else 6 | # include 7 | # include 8 | 9 | uint8_t eeprom_read_byte(const uint8_t *__p); 10 | uint16_t eeprom_read_word(const uint16_t *__p); 11 | uint32_t eeprom_read_dword(const uint32_t *__p); 12 | void eeprom_read_block(void *__dst, const void *__src, size_t __n); 13 | void eeprom_write_byte(uint8_t *__p, uint8_t __value); 14 | void eeprom_write_word(uint16_t *__p, uint16_t __value); 15 | void eeprom_write_dword(uint32_t *__p, uint32_t __value); 16 | void eeprom_write_block(const void *__src, void *__dst, size_t __n); 17 | void eeprom_update_byte(uint8_t *__p, uint8_t __value); 18 | void eeprom_update_word(uint16_t *__p, uint16_t __value); 19 | void eeprom_update_dword(uint32_t *__p, uint32_t __value); 20 | void eeprom_update_block(const void *__src, void *__dst, size_t __n); 21 | #endif 22 | -------------------------------------------------------------------------------- /keyboards/planck/readme.md: -------------------------------------------------------------------------------- 1 | Planck 2 | === 3 | 4 | ![Planck](http://i.imgur.com/q2M3uEU.jpg) 5 | 6 | A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. [More info on qmk.fm](http://qmk.fm/planck/) 7 | 8 | Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) 9 | Hardware Supported: Planck PCB rev1, rev2, rev3, rev4, rev5, rev6; Planck Light, Planck EZ 10 | Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open), [Ergodox (Planck EZ)](https://ergodox-ez.com/pages/planck) 11 | 12 | Make example for this keyboard (after setting up your build environment): 13 | 14 | make planck/rev4:default 15 | 16 | Install examples: 17 | 18 | make planck/rev6:default:dfu-util 19 | 20 | See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. 21 | -------------------------------------------------------------------------------- /quantum/api/api_sysex.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Jack Humbert 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "api.h" 20 | 21 | void send_bytes_sysex(uint8_t message_type, uint8_t data_type, uint8_t* bytes, uint16_t length); 22 | 23 | #define SEND_BYTES(mt, dt, b, l) send_bytes_sysex(mt, dt, b, l) 24 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/max_LCD/max_LCD.ino: -------------------------------------------------------------------------------- 1 | // Just a copy of the HelloWorld example bundled with the LiquidCrystal library in the Arduino IDE 2 | 3 | // HD44780 compatible LCD display via MAX3421E GPOUT support header 4 | // pinout: D[4-7] -> GPOUT[4-7], RS-> GPOUT[2], E ->GPOUT[3] 5 | 6 | #include 7 | 8 | // Satisfy IDE, which only needs to see the include statment in the ino. 9 | #ifdef dobogusinclude 10 | #include 11 | #include 12 | #endif 13 | 14 | USB Usb; 15 | Max_LCD lcd(&Usb); 16 | 17 | void setup() { 18 | // Set up the LCD's number of columns and rows: 19 | lcd.begin(16, 2); 20 | // Print a message to the LCD. 21 | lcd.print("Hello, World!"); 22 | } 23 | 24 | void loop() { 25 | // Set the cursor to column 0, line 1 (note: line 1 is the second row, since counting begins with 0): 26 | lcd.setCursor(0, 1); 27 | // Print the number of seconds since reset: 28 | lcd.print(millis() / 1000); 29 | } 30 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/alpha_mods_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_ALPHAS_MODS 2 | RGB_MATRIX_EFFECT(ALPHAS_MODS) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | // alphas = color1, mods = color2 6 | bool ALPHAS_MODS(effect_params_t* params) { 7 | RGB_MATRIX_USE_LIMITS(led_min, led_max); 8 | 9 | HSV hsv = rgb_matrix_config.hsv; 10 | RGB rgb1 = rgb_matrix_hsv_to_rgb(hsv); 11 | hsv.h += rgb_matrix_config.speed; 12 | RGB rgb2 = rgb_matrix_hsv_to_rgb(hsv); 13 | 14 | for (uint8_t i = led_min; i < led_max; i++) { 15 | RGB_MATRIX_TEST_LED_FLAGS(); 16 | if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { 17 | rgb_matrix_set_color(i, rgb2.r, rgb2.g, rgb2.b); 18 | } else { 19 | rgb_matrix_set_color(i, rgb1.r, rgb1.g, rgb1.b); 20 | } 21 | } 22 | return led_max < DRIVER_LED_TOTAL; 23 | } 24 | 25 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 26 | #endif // DISABLE_RGB_MATRIX_ALPHAS_MODS 27 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_animations/gradient_left_right_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT 2 | RGB_MATRIX_EFFECT(GRADIENT_LEFT_RIGHT) 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 4 | 5 | bool GRADIENT_LEFT_RIGHT(effect_params_t* params) { 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); 7 | 8 | HSV hsv = rgb_matrix_config.hsv; 9 | uint8_t scale = scale8(64, rgb_matrix_config.speed); 10 | for (uint8_t i = led_min; i < led_max; i++) { 11 | RGB_MATRIX_TEST_LED_FLAGS(); 12 | // The x range will be 0..224, map this to 0..7 13 | // Relies on hue being 8-bit and wrapping 14 | hsv.h = rgb_matrix_config.hsv.h + (scale * g_led_config.point[i].x >> 5); 15 | RGB rgb = rgb_matrix_hsv_to_rgb(hsv); 16 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); 17 | } 18 | return led_max < DRIVER_LED_TOTAL; 19 | } 20 | 21 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 22 | #endif // DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT 23 | -------------------------------------------------------------------------------- /quantum/visualizer/visualizer_keyframes.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Fred Sundvik 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #include "visualizer_keyframes.h" 18 | 19 | bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state) { 20 | (void)animation; 21 | (void)state; 22 | return false; 23 | } 24 | -------------------------------------------------------------------------------- /tmk_core/protocol/serial_mouse.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2014 Robin Haberkorn 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | #include "serial.h" 23 | 24 | static inline uint8_t serial_mouse_init(void) { 25 | serial_init(); 26 | return 0; 27 | } 28 | 29 | void serial_mouse_task(void); 30 | -------------------------------------------------------------------------------- /tmk_core/common/sendchar.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | /* transmit a character. return 0 on success, -1 on error. */ 27 | int8_t sendchar(uint8_t c); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/WiiCameraReadme.md: -------------------------------------------------------------------------------- 1 | Please see for the complete capabilities of the Wii camera. The IR camera code was written based on the above website and with support from Kristian Lauszus. 2 | 3 | This library is large, if you run into memory problems when uploading to the Arduino, disable serial debugging. 4 | 5 | To enable the IR camera code, simply set ```ENABLE_WII_IR_CAMERA``` to 1 in [settings.h](settings.h). 6 | 7 | This library implements the following settings: 8 | 9 | * Report sensitivity mode: 00 00 00 00 00 00 90 00 41 40 00 Suggested by inio (high sensitivity) 10 | * Data Format: Extended mode (0x03). Full mode is not working yet. The output reports 0x3e and 0x3f need tampering with 11 | * In this mode the camera outputs x and y coordinates and a size dimension for the 4 brightest points. 12 | 13 | Again, read through to get an understanding of the camera and its settings. 14 | -------------------------------------------------------------------------------- /quantum/template/ps2avrgb/i2c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2016 Luiz Ribeiro 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | // Please do not modify this file 19 | 20 | #ifndef __I2C_H__ 21 | #define __I2C_H__ 22 | 23 | void i2c_init(void); 24 | void i2c_set_bitrate(uint16_t bitrate_khz); 25 | uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /tests/test_common/test_common.hpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Fred Sundvik 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #include "gtest/gtest.h" 18 | #include "gmock/gmock.h" 19 | 20 | extern "C" { 21 | #include "quantum.h" 22 | } 23 | #include "test_driver.hpp" 24 | #include "test_matrix.h" 25 | #include "keyboard_report_util.hpp" 26 | #include "test_fixture.hpp" 27 | -------------------------------------------------------------------------------- /quantum/process_keycode/process_space_cadet.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 Jack Humbert 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | #pragma once 17 | 18 | #include "quantum.h" 19 | 20 | void perform_space_cadet(keyrecord_t *record, uint16_t sc_keycode, uint8_t holdMod, uint8_t tapMod, uint8_t keycode); 21 | bool process_space_cadet(uint16_t keycode, keyrecord_t *record); 22 | -------------------------------------------------------------------------------- /tests/test_common/test_matrix.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Fred Sundvik 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | void press_key(uint8_t col, uint8_t row); 24 | void release_key(uint8_t col, uint8_t row); 25 | void clear_all_keys(void); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /drivers/ugfx/gdisp/st7565/gdisp_lld_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is subject to the terms of the GFX License. If a copy of 3 | * the license was not distributed with this file, you can obtain one at: 4 | * 5 | * http://ugfx.org/license.html 6 | */ 7 | 8 | #ifndef _GDISP_LLD_CONFIG_H 9 | #define _GDISP_LLD_CONFIG_H 10 | 11 | #if GFX_USE_GDISP 12 | 13 | /*===========================================================================*/ 14 | /* Driver hardware support. */ 15 | /*===========================================================================*/ 16 | 17 | # define GDISP_HARDWARE_FLUSH GFXON // This controller requires flushing 18 | # define GDISP_HARDWARE_DRAWPIXEL GFXON 19 | # define GDISP_HARDWARE_PIXELREAD GFXON 20 | # define GDISP_HARDWARE_CONTROL GFXON 21 | # define GDISP_HARDWARE_BITFILLS GFXON 22 | 23 | # define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO 24 | 25 | #endif /* GFX_USE_GDISP */ 26 | 27 | #endif /* _GDISP_LLD_CONFIG_H */ 28 | -------------------------------------------------------------------------------- /quantum/process_keycode/process_unicodemap.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Jack Humbert 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "process_unicode_common.h" 20 | 21 | extern const uint32_t PROGMEM unicode_map[]; 22 | 23 | uint16_t unicodemap_index(uint16_t keycode); 24 | bool process_unicodemap(uint16_t keycode, keyrecord_t *record); 25 | -------------------------------------------------------------------------------- /tmk_core/protocol/arm_atsam.mk: -------------------------------------------------------------------------------- 1 | ARM_ATSAM_DIR = protocol/arm_atsam 2 | 3 | SRC += $(ARM_ATSAM_DIR)/adc.c 4 | SRC += $(ARM_ATSAM_DIR)/clks.c 5 | SRC += $(ARM_ATSAM_DIR)/d51_util.c 6 | SRC += $(ARM_ATSAM_DIR)/i2c_master.c 7 | ifeq ($(RGB_MATRIX_DRIVER),custom) 8 | SRC += $(ARM_ATSAM_DIR)/md_rgb_matrix_programs.c 9 | SRC += $(ARM_ATSAM_DIR)/md_rgb_matrix.c 10 | endif 11 | SRC += $(ARM_ATSAM_DIR)/main_arm_atsam.c 12 | SRC += $(ARM_ATSAM_DIR)/spi.c 13 | SRC += $(ARM_ATSAM_DIR)/startup.c 14 | 15 | SRC += $(ARM_ATSAM_DIR)/usb/main_usb.c 16 | SRC += $(ARM_ATSAM_DIR)/usb/udc.c 17 | SRC += $(ARM_ATSAM_DIR)/usb/udi_cdc.c 18 | SRC += $(ARM_ATSAM_DIR)/usb/udi_hid.c 19 | SRC += $(ARM_ATSAM_DIR)/usb/udi_hid_kbd.c 20 | SRC += $(ARM_ATSAM_DIR)/usb/udi_hid_kbd_desc.c 21 | SRC += $(ARM_ATSAM_DIR)/usb/ui.c 22 | SRC += $(ARM_ATSAM_DIR)/usb/usb2422.c 23 | SRC += $(ARM_ATSAM_DIR)/usb/usb.c 24 | SRC += $(ARM_ATSAM_DIR)/usb/usb_device_udd.c 25 | SRC += $(ARM_ATSAM_DIR)/usb/usb_util.c 26 | 27 | # Search Path 28 | VPATH += $(TMK_DIR)/$(ARM_ATSAM_DIR) 29 | -------------------------------------------------------------------------------- /lib/python/qmk/datetime.py: -------------------------------------------------------------------------------- 1 | """Functions to work with dates and times in a uniform way. 2 | 3 | The results of these functions are cached for 5 seconds to provide uniform time strings across short running processes. Long running processes that need more precise timekeeping should not use these functions. 4 | """ 5 | from time import gmtime, strftime 6 | 7 | from qmk.constants import DATE_FORMAT, DATETIME_FORMAT, TIME_FORMAT 8 | from qmk.decorators import lru_cache 9 | 10 | 11 | @lru_cache(timeout=5) 12 | def current_date(): 13 | """Returns the current time in UTZ as a formatted string. 14 | """ 15 | return strftime(DATE_FORMAT, gmtime()) 16 | 17 | 18 | @lru_cache(timeout=5) 19 | def current_datetime(): 20 | """Returns the current time in UTZ as a formatted string. 21 | """ 22 | return strftime(DATETIME_FORMAT, gmtime()) 23 | 24 | 25 | @lru_cache(timeout=5) 26 | def current_time(): 27 | """Returns the current time in UTZ as a formatted string. 28 | """ 29 | return strftime(TIME_FORMAT, gmtime()) 30 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/HID/USBHIDJoystick/hidjoystickrptparser.h: -------------------------------------------------------------------------------- 1 | #if !defined(__HIDJOYSTICKRPTPARSER_H__) 2 | #define __HIDJOYSTICKRPTPARSER_H__ 3 | 4 | #include 5 | 6 | struct GamePadEventData { 7 | uint8_t X, Y, Z1, Z2, Rz; 8 | }; 9 | 10 | class JoystickEvents { 11 | public: 12 | virtual void OnGamePadChanged(const GamePadEventData *evt); 13 | virtual void OnHatSwitch(uint8_t hat); 14 | virtual void OnButtonUp(uint8_t but_id); 15 | virtual void OnButtonDn(uint8_t but_id); 16 | }; 17 | 18 | #define RPT_GEMEPAD_LEN 5 19 | 20 | class JoystickReportParser : public HIDReportParser { 21 | JoystickEvents *joyEvents; 22 | 23 | uint8_t oldPad[RPT_GEMEPAD_LEN]; 24 | uint8_t oldHat; 25 | uint16_t oldButtons; 26 | 27 | public: 28 | JoystickReportParser(JoystickEvents *evt); 29 | 30 | virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf); 31 | }; 32 | 33 | #endif // __HIDJOYSTICKRPTPARSER_H__ 34 | -------------------------------------------------------------------------------- /drivers/qwiic/qwiic.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 Jack Humbert 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | #pragma once 17 | 18 | #include "i2c_master.h" 19 | 20 | #ifdef QWIIC_JOYSTIIC_ENABLE 21 | # include "joystiic.h" 22 | #endif 23 | #ifdef QWIIC_MICRO_OLED_ENABLE 24 | # include "micro_oled.h" 25 | #endif 26 | 27 | void qwiic_init(void); 28 | void qwiic_task(void); 29 | -------------------------------------------------------------------------------- /quantum/visualizer/visualizer_keyframes.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Fred Sundvik 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "visualizer.h" 20 | 21 | // Some predefined keyframe functions that can be used by the user code 22 | // Does nothing, useful for adding delays 23 | bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state); 24 | -------------------------------------------------------------------------------- /quantum/template/avr/rules.mk: -------------------------------------------------------------------------------- 1 | # MCU name 2 | #MCU = at90usb1286 3 | MCU = atmega32u4 4 | 5 | 6 | # Bootloader selection 7 | BOOTLOADER = atmel-dfu 8 | 9 | # Build Options 10 | # change yes to no to disable 11 | # 12 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration 13 | MOUSEKEY_ENABLE = yes # Mouse keys 14 | EXTRAKEY_ENABLE = yes # Audio control and System control 15 | CONSOLE_ENABLE = no # Console for debug 16 | COMMAND_ENABLE = no # Commands for debug and configuration 17 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 18 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend 19 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work 20 | NKRO_ENABLE = no # USB Nkey Rollover 21 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality 22 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow 23 | BLUETOOTH_ENABLE = no # Enable Bluetooth 24 | AUDIO_ENABLE = no # Audio output 25 | -------------------------------------------------------------------------------- /keyboards/ergodox_ez/shine/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 Jun Wako 3 | Copyright 2013 Oleg Kostyuk 4 | Copyright 2015 ZSA Technology Labs Inc (@zsa) 5 | Copyright 2020 Christopher Courtney (@drashna) 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 2 of the License, or 9 | (at your option) any later version. 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #pragma once 19 | 20 | #undef PRODUCT_ID 21 | #define PRODUCT_ID 0x4975 22 | #undef PRODUCT 23 | #define PRODUCT ErgoDox EZ Shine 24 | -------------------------------------------------------------------------------- /platforms/chibios/BLACKPILL_STM32_F401/configs/config.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Nick Brassel (tzarc) 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 3 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | #pragma once 17 | 18 | #define BOARD_OTG_NOVBUSSENS 1 19 | 20 | #define STM32_LSECLK 32768U 21 | #define STM32_HSECLK 25000000U 22 | 23 | #ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP 24 | # define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE 25 | #endif 26 | -------------------------------------------------------------------------------- /platforms/chibios/BLACKPILL_STM32_F411/configs/config.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Nick Brassel (tzarc) 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 3 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | #pragma once 17 | 18 | #define BOARD_OTG_NOVBUSSENS 1 19 | 20 | #define STM32_LSECLK 32768U 21 | #define STM32_HSECLK 25000000U 22 | 23 | #ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP 24 | # define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE 25 | #endif 26 | -------------------------------------------------------------------------------- /quantum/process_keycode/process_terminal.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Jack Humbert 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "quantum.h" 20 | 21 | extern const char keycode_to_ascii_lut[58]; 22 | extern const char shifted_keycode_to_ascii_lut[58]; 23 | extern const char terminal_prompt[8]; 24 | bool process_terminal(uint16_t keycode, keyrecord_t *record); 25 | -------------------------------------------------------------------------------- /quantum/template/ps2avrgb/readme.md: -------------------------------------------------------------------------------- 1 | # %KEYBOARD% 2 | 3 | ![%KEYBOARD%](imgur.com image replace me!) 4 | 5 | *A short description of the keyboard/project* 6 | 7 | * Keyboard Maintainer: [%YOUR_NAME%](https://github.com/yourusername) 8 | * Hardware Supported: *The PCBs, controllers supported* 9 | * Hardware Availability: *Links to where you can find this hardware* 10 | 11 | Make example for this keyboard (after setting up your build environment): 12 | 13 | make %KEYBOARD%:default 14 | 15 | Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](flashing_bootloadhid.md)) 16 | 17 | make %KEYBOARD%:default:flash 18 | 19 | **Reset Key**: Hold down the key located at *LOCATION*, commonly programmed as *KEY* while plugging in the keyboard. 20 | 21 | 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). 22 | -------------------------------------------------------------------------------- /keyboards/ergodox_ez/glow/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 Jun Wako 3 | Copyright 2013 Oleg Kostyuk 4 | Copyright 2015 ZSA Technology Labs Inc (@zsa) 5 | Copyright 2020 Christopher Courtney (@drashna) 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 2 of the License, or 10 | (at your option) any later version. 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #undef PRODUCT_ID 22 | #define PRODUCT_ID 0x4976 23 | #undef PRODUCT 24 | #define PRODUCT ErgoDox EZ Glow 25 | -------------------------------------------------------------------------------- /tmk_core/common/magic.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #if defined(__AVR__) 4 | # include 5 | #endif 6 | #include "matrix.h" 7 | #include "bootloader.h" 8 | #include "debug.h" 9 | #include "keymap.h" 10 | #include "host.h" 11 | #include "action_layer.h" 12 | #include "eeconfig.h" 13 | #include "magic.h" 14 | 15 | keymap_config_t keymap_config; 16 | 17 | /** \brief Magic 18 | * 19 | * FIXME: Needs doc 20 | */ 21 | void magic(void) { 22 | /* check signature */ 23 | if (!eeconfig_is_enabled()) { 24 | eeconfig_init(); 25 | } 26 | 27 | /* debug enable */ 28 | debug_config.raw = eeconfig_read_debug(); 29 | 30 | /* keymap config */ 31 | keymap_config.raw = eeconfig_read_keymap(); 32 | 33 | uint8_t default_layer = 0; 34 | default_layer = eeconfig_read_default_layer(); 35 | default_layer_set((layer_state_t)default_layer); 36 | 37 | /* Also initialize layer state to trigger callback functions for layer_state */ 38 | layer_state_set_kb((layer_state_t)layer_state); 39 | } 40 | -------------------------------------------------------------------------------- /quantum/sequencer/tests/midi_mock.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Rodolphe Belouin 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | extern uint16_t last_noteon; 22 | extern uint16_t last_noteoff; 23 | 24 | uint16_t midi_compute_note(uint16_t keycode); 25 | void process_midi_basic_noteon(uint16_t note); 26 | void process_midi_basic_noteoff(uint16_t note); 27 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/HID/le3dp/le3dp_rptparser.h: -------------------------------------------------------------------------------- 1 | #if !defined(__HIDJOYSTICKRPTPARSER_H__) 2 | #define __HIDJOYSTICKRPTPARSER_H__ 3 | 4 | #include 5 | 6 | struct GamePadEventData 7 | { 8 | union { //axes and hut switch 9 | uint32_t axes; 10 | struct { 11 | uint32_t x : 10; 12 | uint32_t y : 10; 13 | uint32_t hat : 4; 14 | uint32_t twist : 8; 15 | }; 16 | }; 17 | uint8_t buttons_a; 18 | uint8_t slider; 19 | uint8_t buttons_b; 20 | }; 21 | 22 | class JoystickEvents 23 | { 24 | public: 25 | virtual void OnGamePadChanged(const GamePadEventData *evt); 26 | }; 27 | 28 | #define RPT_GAMEPAD_LEN sizeof(GamePadEventData)/sizeof(uint8_t) 29 | 30 | class JoystickReportParser : public HIDReportParser 31 | { 32 | JoystickEvents *joyEvents; 33 | 34 | uint8_t oldPad[RPT_GAMEPAD_LEN]; 35 | 36 | public: 37 | JoystickReportParser(JoystickEvents *evt); 38 | 39 | virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf); 40 | }; 41 | 42 | #endif // __HIDJOYSTICKRPTPARSER_H__ 43 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs 2 | # editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | indent_style = space 8 | indent_size = 4 9 | 10 | # We recommend you to keep these unchanged 11 | charset = utf-8 12 | trim_trailing_whitespace = true 13 | insert_final_newline = true 14 | 15 | [*.md] 16 | trim_trailing_whitespace = false 17 | indent_size = 4 18 | 19 | [{qmk,*.py}] 20 | charset = utf-8 21 | max_line_length = 200 22 | 23 | # Make these match what we have in .gitattributes 24 | [*.mk] 25 | end_of_line = lf 26 | indent_style = tab 27 | 28 | [Makefile] 29 | end_of_line = lf 30 | indent_style = tab 31 | 32 | [*.sh] 33 | end_of_line = lf 34 | 35 | # The gitattributes file will handle the line endings conversion properly according to the operating system settings for other files 36 | 37 | 38 | # We don't have gitattributes properly for these 39 | # So if the user have for example core.autocrlf set to true 40 | # the line endings would be wrong. 41 | [lib/**] 42 | end_of_line = unset 43 | -------------------------------------------------------------------------------- /drivers/issi/is31fl3218.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 Jason Williams (Wilba) 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | 22 | void IS31FL3218_init(void); 23 | void IS31FL3218_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); 24 | void IS31FL3218_set_color_all(uint8_t red, uint8_t green, uint8_t blue); 25 | void IS31FL3218_update_pwm_buffers(void); 26 | -------------------------------------------------------------------------------- /drivers/eeprom/eeprom_transient.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 Nick Brassel (tzarc) 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | /* 20 | The size of the transient EEPROM buffer size. 21 | */ 22 | #ifndef TRANSIENT_EEPROM_SIZE 23 | # include "eeconfig.h" 24 | # define TRANSIENT_EEPROM_SIZE (((EECONFIG_SIZE + 3) / 4) * 4) // based off eeconfig's current usage, aligned to 4-byte sizes, to deal with LTO 25 | #endif 26 | -------------------------------------------------------------------------------- /drivers/qwiic/qwiic.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 Jack Humbert 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | #include "qwiic.h" 17 | 18 | void qwiic_init(void) { 19 | #ifdef QWIIC_JOYSTIIC_ENABLE 20 | joystiic_init(); 21 | #endif 22 | #ifdef QWIIC_MICRO_OLED_ENABLE 23 | micro_oled_init(); 24 | #endif 25 | } 26 | 27 | void qwiic_task(void) { 28 | #ifdef QWIIC_JOYSTIIC_ENABLE 29 | joystiic_task(); 30 | #endif 31 | } 32 | -------------------------------------------------------------------------------- /tests/test_common/test_fixture.hpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Fred Sundvik 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "gtest/gtest.h" 20 | 21 | class TestFixture : public testing::Test { 22 | public: 23 | TestFixture(); 24 | ~TestFixture(); 25 | static void SetUpTestCase(); 26 | static void TearDownTestCase(); 27 | 28 | void run_one_scan_loop(); 29 | void idle_for(unsigned ms); 30 | }; 31 | -------------------------------------------------------------------------------- /keyboards/planck/planck.c: -------------------------------------------------------------------------------- 1 | #include "planck.h" 2 | 3 | #ifdef SWAP_HANDS_ENABLE 4 | __attribute__ ((weak)) 5 | const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { 6 | {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, 7 | {{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, 8 | {{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, 9 | {{11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, 10 | }; 11 | #endif 12 | 13 | __attribute__ ((weak)) 14 | void matrix_init_kb(void) { 15 | // Turn status LED on 16 | #ifdef __AVR__ 17 | DDRE |= (1<<6); 18 | PORTE |= (1<<6); 19 | #endif 20 | 21 | matrix_init_user(); 22 | } 23 | 24 | const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_planck_grid( 25 | 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 26 | 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 27 | 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 28 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 29 | ); -------------------------------------------------------------------------------- /quantum/sequencer/tests/midi_mock.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Rodolphe Belouin 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #include "midi_mock.h" 18 | 19 | uint16_t last_noteon = 0; 20 | uint16_t last_noteoff = 0; 21 | 22 | uint16_t midi_compute_note(uint16_t keycode) { return keycode; } 23 | 24 | void process_midi_basic_noteon(uint16_t note) { last_noteon = note; } 25 | 26 | void process_midi_basic_noteoff(uint16_t note) { last_noteoff = note; } 27 | -------------------------------------------------------------------------------- /drivers/ugfx/gdisp/st7565/st7565.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is subject to the terms of the GFX License. If a copy of 3 | * the license was not distributed with this file, you can obtain one at: 4 | * 5 | * http://ugfx.org/license.html 6 | */ 7 | 8 | #ifndef _ST7565_H 9 | #define _ST7565_H 10 | 11 | #define ST7565_CONTRAST 0x81 12 | #define ST7565_ALLON_NORMAL 0xA4 13 | #define ST7565_ALLON 0xA5 14 | #define ST7565_POSITIVE_DISPLAY 0xA6 15 | #define ST7565_INVERT_DISPLAY 0xA7 16 | #define ST7565_DISPLAY_OFF 0xAE 17 | #define ST7565_DISPLAY_ON 0xAF 18 | 19 | #define ST7565_LCD_BIAS_7 0xA3 20 | #define ST7565_LCD_BIAS_9 0xA2 21 | 22 | #define ST7565_ADC_NORMAL 0xA0 23 | #define ST7565_ADC_REVERSE 0xA1 24 | 25 | #define ST7565_COM_SCAN_INC 0xC0 26 | #define ST7565_COM_SCAN_DEC 0xC8 27 | 28 | #define ST7565_START_LINE 0x40 29 | #define ST7565_PAGE 0xB0 30 | #define ST7565_COLUMN_MSB 0x10 31 | #define ST7565_COLUMN_LSB 0x00 32 | #define ST7565_RMW 0xE0 33 | 34 | #define ST7565_RESISTOR_RATIO 0x20 35 | #define ST7565_POWER_CONTROL 0x28 36 | 37 | #define ST7565_RESET 0xE2 38 | 39 | #endif /* _ST7565_H */ 40 | -------------------------------------------------------------------------------- /quantum/wpm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Richard Sutherland (rich@brickbots.com) 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #pragma once 19 | 20 | #include "quantum.h" 21 | 22 | bool wpm_keycode(uint16_t keycode); 23 | bool wpm_keycode_kb(uint16_t keycode); 24 | bool wpm_keycode_user(uint16_t keycode); 25 | 26 | void set_current_wpm(uint8_t); 27 | uint8_t get_current_wpm(void); 28 | void update_wpm(uint16_t); 29 | 30 | void decay_wpm(void); 31 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve the QMK Firmware 4 | --- 5 | 6 | 7 | 8 | 9 | 10 | ## Describe the Bug 11 | 12 | 13 | 14 | ## System Information 15 | 16 | - Keyboard: 17 | - Revision (if applicable): 18 | - Operating system: 19 | - AVR GCC version: 20 | 21 | - ARM GCC version: 22 | 23 | - QMK Firmware version: 24 | 25 | - Any keyboard related software installed? 26 | - [ ] AutoHotKey 27 | - [ ] Karabiner 28 | - [ ] Other: 29 | 30 | ## Additional Context 31 | 32 | 33 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/HID/USBHIDJoystick/USBHIDJoystick.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | // Satisfy IDE, which only needs to see the include statment in the ino. 6 | #ifdef dobogusinclude 7 | #include 8 | #include 9 | #endif 10 | 11 | #include "hidjoystickrptparser.h" 12 | 13 | USB Usb; 14 | USBHub Hub(&Usb); 15 | HIDUniversal Hid(&Usb); 16 | JoystickEvents JoyEvents; 17 | JoystickReportParser Joy(&JoyEvents); 18 | 19 | void setup() { 20 | Serial.begin(115200); 21 | #if !defined(__MIPSEL__) 22 | while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection 23 | #endif 24 | Serial.println("Start"); 25 | 26 | if (Usb.Init() == -1) 27 | Serial.println("OSC did not start."); 28 | 29 | delay(200); 30 | 31 | if (!Hid.SetReportParser(0, &Joy)) 32 | ErrorMessage (PSTR("SetReportParser"), 1); 33 | } 34 | 35 | void loop() { 36 | Usb.Task(); 37 | } 38 | 39 | -------------------------------------------------------------------------------- /lib/python/qmk/math.py: -------------------------------------------------------------------------------- 1 | """Parse arbitrary math equations in a safe way. 2 | 3 | Gratefully copied from https://stackoverflow.com/a/9558001 4 | """ 5 | import ast 6 | import operator as op 7 | 8 | # supported operators 9 | operators = {ast.Add: op.add, ast.Sub: op.sub, ast.Mult: op.mul, ast.Div: op.truediv, ast.Pow: op.pow, ast.BitXor: op.xor, ast.USub: op.neg} 10 | 11 | 12 | def compute(expr): 13 | """Parse a mathematical expression and return the answer. 14 | 15 | >>> compute('2^6') 16 | 4 17 | >>> compute('2**6') 18 | 64 19 | >>> compute('1 + 2*3**(4^5) / (6 + -7)') 20 | -5.0 21 | """ 22 | return _eval(ast.parse(expr, mode='eval').body) 23 | 24 | 25 | def _eval(node): 26 | if isinstance(node, ast.Num): # 27 | return node.n 28 | elif isinstance(node, ast.BinOp): # 29 | return operators[type(node.op)](_eval(node.left), _eval(node.right)) 30 | elif isinstance(node, ast.UnaryOp): # e.g., -1 31 | return operators[type(node.op)](_eval(node.operand)) 32 | else: 33 | raise TypeError(node) 34 | -------------------------------------------------------------------------------- /quantum/process_keycode/process_steno.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Joseph Wasson 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "quantum.h" 20 | 21 | typedef enum { STENO_MODE_BOLT, STENO_MODE_GEMINI } steno_mode_t; 22 | 23 | bool process_steno(uint16_t keycode, keyrecord_t *record); 24 | void steno_init(void); 25 | void steno_set_mode(steno_mode_t mode); 26 | uint8_t *steno_get_state(void); 27 | uint8_t *steno_get_chord(void); 28 | -------------------------------------------------------------------------------- /quantum/pointing_device.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017 Joshua Broekhuijsen 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #pragma once 19 | 20 | #include 21 | #include "host.h" 22 | #include "report.h" 23 | 24 | void pointing_device_init(void); 25 | void pointing_device_task(void); 26 | void pointing_device_send(void); 27 | report_mouse_t pointing_device_get_report(void); 28 | void pointing_device_set_report(report_mouse_t newMouseReport); 29 | -------------------------------------------------------------------------------- /quantum/serial_link/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /util/install/opensuse.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | _qmk_install_prepare() { 4 | case $(grep ID /etc/os-release) in 5 | *15.1*) 6 | REPO_RELEASE=Leap_15.1;; 7 | *15.2*) 8 | REPO_RELEASE=Leap_15.2;; 9 | *) 10 | #REPO_RELEASE=Tumbleweed;; 11 | echo "ERROR: Tumbleweed is currently not supported." 12 | exit 1 13 | esac 14 | 15 | sudo zypper addrepo https://download.opensuse.org/repositories/devel:gcc/openSUSE_$REPO_RELEASE/devel:gcc.repo 16 | sudo zypper addrepo https://download.opensuse.org/repositories/hardware/openSUSE_$REPO_RELEASE/hardware.repo 17 | sudo zypper --gpg-auto-import-keys refresh 18 | } 19 | 20 | _qmk_install() { 21 | echo "Installing dependencies" 22 | 23 | sudo zypper install -y \ 24 | make clang gcc unzip wget zip \ 25 | python3-pip \ 26 | cross-avr-binutils cross-avr-gcc8 avr-libc \ 27 | cross-arm-binutils cross-arm-none-gcc8 cross-arm-none-newlib-devel \ 28 | avrdude dfu-programmer dfu-util 29 | 30 | python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt 31 | } 32 | -------------------------------------------------------------------------------- /tmk_core/protocol/arm_atsam/usb/udi_device_epsize.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Massdrop Inc. 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef _UDI_DEVICE_EPSIZE_H_ 19 | #define _UDI_DEVICE_EPSIZE_H_ 20 | 21 | #define KEYBOARD_EPSIZE 8 22 | #define MOUSE_EPSIZE 8 23 | #define EXTRAKEY_EPSIZE 8 24 | #define RAW_EPSIZE 32 25 | #define CONSOLE_EPSIZE 32 26 | #define NKRO_EPSIZE 32 27 | #define MIDI_STREAM_EPSIZE 64 28 | #define CDC_NOTIFICATION_EPSIZE 8 29 | #define CDC_EPSIZE 16 30 | 31 | #endif //_UDI_DEVICE_EPSIZE_H_ 32 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/test/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #pragma once 19 | 20 | #define VENDOR_ID 0xFEED 21 | #define PRODUCT_ID 0xCAFE 22 | #define DEVICE_VER 0x0814 23 | #define MANUFACTURER t.m.k. 24 | #define PRODUCT USB to USB keyboard converter 25 | 26 | #define DESCRIPTION Product from t.m.k. keyboard firmware project 27 | 28 | /* matrix size */ 29 | #define MATRIX_ROWS 32 30 | #define MATRIX_COLS 8 31 | -------------------------------------------------------------------------------- /lib/python/qmk/constants.py: -------------------------------------------------------------------------------- 1 | """Information that should be available to the python library. 2 | """ 3 | from os import environ 4 | from pathlib import Path 5 | 6 | # The root of the qmk_firmware tree. 7 | QMK_FIRMWARE = Path.cwd() 8 | 9 | # This is the number of directories under `qmk_firmware/keyboards` that will be traversed. This is currently a limitation of our make system. 10 | MAX_KEYBOARD_SUBFOLDERS = 5 11 | 12 | # Supported processor types 13 | CHIBIOS_PROCESSORS = 'cortex-m0', 'cortex-m0plus', 'cortex-m3', 'cortex-m4', 'MKL26Z64', 'MK20DX128', 'MK20DX256', 'STM32F042', 'STM32F072', 'STM32F103', 'STM32F303', 'STM32F401', 'STM32F411' 14 | LUFA_PROCESSORS = 'atmega16u2', 'atmega32u2', 'atmega16u4', 'atmega32u4', 'at90usb646', 'at90usb647', 'at90usb1286', 'at90usb1287', None 15 | VUSB_PROCESSORS = 'atmega32a', 'atmega328p', 'atmega328', 'attiny85' 16 | 17 | # Common format strings 18 | DATE_FORMAT = '%Y-%m-%d' 19 | DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S %Z' 20 | TIME_FORMAT = '%H:%M:%S' 21 | 22 | # Constants that should match their counterparts in make 23 | BUILD_DIR = environ.get('BUILD_DIR', '.build') 24 | KEYBOARD_OUTPUT_PREFIX = f'{BUILD_DIR}/obj_' 25 | -------------------------------------------------------------------------------- /tmk_core/common/host_driver.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Jun Wako 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #pragma once 19 | 20 | #include 21 | #include "report.h" 22 | #ifdef MIDI_ENABLE 23 | # include "midi.h" 24 | #endif 25 | 26 | typedef struct { 27 | uint8_t (*keyboard_leds)(void); 28 | void (*send_keyboard)(report_keyboard_t *); 29 | void (*send_mouse)(report_mouse_t *); 30 | void (*send_system)(uint16_t); 31 | void (*send_consumer)(uint16_t); 32 | } host_driver_t; 33 | -------------------------------------------------------------------------------- /lib/lib8tion/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 FastLED 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /quantum/encoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Jack Humbert 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #pragma once 19 | 20 | #include "quantum.h" 21 | 22 | void encoder_init(void); 23 | void encoder_read(void); 24 | 25 | void encoder_update_kb(int8_t index, bool clockwise); 26 | void encoder_update_user(int8_t index, bool clockwise); 27 | 28 | #ifdef SPLIT_KEYBOARD 29 | void encoder_state_raw(uint8_t* slave_state); 30 | void encoder_update_raw(uint8_t* slave_state); 31 | #endif 32 | -------------------------------------------------------------------------------- /keyboards/planck/keymaps/default/config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef AUDIO_ENABLE 4 | #define STARTUP_SONG SONG(PLANCK_SOUND) 5 | // #define STARTUP_SONG SONG(NO_SOUND) 6 | 7 | #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ 8 | SONG(COLEMAK_SOUND), \ 9 | SONG(DVORAK_SOUND) \ 10 | } 11 | #endif 12 | 13 | /* 14 | * MIDI options 15 | */ 16 | 17 | /* Prevent use of disabled MIDI features in the keymap */ 18 | //#define MIDI_ENABLE_STRICT 1 19 | 20 | /* enable basic MIDI features: 21 | - MIDI notes can be sent when in Music mode is on 22 | */ 23 | 24 | #define MIDI_BASIC 25 | 26 | /* enable advanced MIDI features: 27 | - MIDI notes can be added to the keymap 28 | - Octave shift and transpose 29 | - Virtual sustain, portamento, and modulation wheel 30 | - etc. 31 | */ 32 | //#define MIDI_ADVANCED 33 | 34 | /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ 35 | //#define MIDI_TONE_KEYCODE_OCTAVES 2 36 | 37 | // Most tactile encoders have detents every 4 stages 38 | #define ENCODER_RESOLUTION 4 39 | 40 | -------------------------------------------------------------------------------- /keyboards/planck/keymaps/webusb/config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef AUDIO_ENABLE 4 | #define STARTUP_SONG SONG(PLANCK_SOUND) 5 | // #define STARTUP_SONG SONG(NO_SOUND) 6 | 7 | #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ 8 | SONG(COLEMAK_SOUND), \ 9 | SONG(DVORAK_SOUND) \ 10 | } 11 | #endif 12 | 13 | /* 14 | * MIDI options 15 | */ 16 | 17 | /* Prevent use of disabled MIDI features in the keymap */ 18 | //#define MIDI_ENABLE_STRICT 1 19 | 20 | /* enable basic MIDI features: 21 | - MIDI notes can be sent when in Music mode is on 22 | */ 23 | 24 | #define MIDI_BASIC 25 | 26 | /* enable advanced MIDI features: 27 | - MIDI notes can be added to the keymap 28 | - Octave shift and transpose 29 | - Virtual sustain, portamento, and modulation wheel 30 | - etc. 31 | */ 32 | //#define MIDI_ADVANCED 33 | 34 | /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ 35 | //#define MIDI_TONE_KEYCODE_OCTAVES 2 36 | 37 | // Most tactile encoders have detents every 4 stages 38 | #define ENCODER_RESOLUTION 4 39 | 40 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_descriptor_common.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Nick Brassel (tzarc) 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | ///////////////////// 20 | // RAW Usage page and ID configuration 21 | 22 | #ifndef RAW_USAGE_PAGE 23 | # define RAW_USAGE_PAGE 0xFF60 24 | #endif 25 | 26 | #ifndef RAW_USAGE_ID 27 | # define RAW_USAGE_ID 0x61 28 | #endif 29 | 30 | #define RAW_USAGE_PAGE_HI ((uint8_t)(RAW_USAGE_PAGE >> 8)) 31 | #define RAW_USAGE_PAGE_LO ((uint8_t)(RAW_USAGE_PAGE & 0xFF)) 32 | -------------------------------------------------------------------------------- /util/install/msys2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | _qmk_install_prepare() { 4 | pacman -Syu 5 | } 6 | 7 | _qmk_install() { 8 | echo "Installing dependencies" 9 | 10 | pacman --needed --noconfirm --disable-download-timeout -S pactoys-git 11 | pacboy sync --needed --noconfirm --disable-download-timeout \ 12 | base-devel: toolchain:x clang:x git: unzip: \ 13 | python3-pip:x \ 14 | avr-binutils:x avr-gcc:x avr-libc:x \ 15 | arm-none-eabi-binutils:x arm-none-eabi-gcc:x arm-none-eabi-newlib:x \ 16 | avrdude:x bootloadhid:x dfu-programmer:x dfu-util:x teensy-loader-cli:x 17 | 18 | _qmk_install_drivers 19 | 20 | python3 -m pip install -r "$QMK_FIRMWARE_DIR/requirements.txt" 21 | } 22 | 23 | _qmk_install_drivers() { 24 | echo "Installing drivers" 25 | 26 | tmpdir=$(mktemp -d) 27 | cp "$QMK_FIRMWARE_UTIL_DIR/drivers.txt" $tmpdir 28 | pushd $tmpdir > /dev/null 29 | 30 | wget "https://github.com/qmk/qmk_driver_installer/releases/download/v1.01/qmk_driver_installer.exe" 31 | 32 | cmd.exe //c "qmk_driver_installer.exe --all --force drivers.txt" 33 | 34 | popd > /dev/null 35 | rm -r $tmpdir 36 | } 37 | -------------------------------------------------------------------------------- /keyboards/planck/ez/glow/keymaps/glow/config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef AUDIO_ENABLE 4 | #define STARTUP_SONG SONG(PLANCK_SOUND) 5 | // #define STARTUP_SONG SONG(NO_SOUND) 6 | 7 | #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ 8 | SONG(COLEMAK_SOUND), \ 9 | SONG(DVORAK_SOUND) \ 10 | } 11 | #endif 12 | 13 | /* 14 | * MIDI options 15 | */ 16 | 17 | /* Prevent use of disabled MIDI features in the keymap */ 18 | //#define MIDI_ENABLE_STRICT 1 19 | 20 | /* enable basic MIDI features: 21 | - MIDI notes can be sent when in Music mode is on 22 | */ 23 | 24 | #define MIDI_BASIC 25 | 26 | /* enable advanced MIDI features: 27 | - MIDI notes can be added to the keymap 28 | - Octave shift and transpose 29 | - Virtual sustain, portamento, and modulation wheel 30 | - etc. 31 | */ 32 | //#define MIDI_ADVANCED 33 | 34 | /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ 35 | //#define MIDI_TONE_KEYCODE_OCTAVES 2 36 | 37 | // Most tactile encoders have detents every 4 stages 38 | #define ENCODER_RESOLUTION 4 39 | 40 | -------------------------------------------------------------------------------- /quantum/audio/luts.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 IBNobody 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #pragma once 18 | 19 | #if defined(__AVR__) 20 | # include 21 | # include 22 | # include 23 | #else 24 | # include 25 | # include 26 | #endif 27 | 28 | #define VIBRATO_LUT_LENGTH 20 29 | 30 | #define FREQUENCY_LUT_LENGTH 349 31 | 32 | extern const float vibrato_lut[VIBRATO_LUT_LENGTH]; 33 | extern const uint16_t frequency_lut[FREQUENCY_LUT_LENGTH]; 34 | -------------------------------------------------------------------------------- /quantum/process_keycode/process_unicode.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Jack Humbert 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | #include "process_unicode.h" 18 | #include "action_util.h" 19 | #include "eeprom.h" 20 | 21 | bool process_unicode(uint16_t keycode, keyrecord_t *record) { 22 | if (keycode >= QK_UNICODE && keycode <= QK_UNICODE_MAX && record->event.pressed) { 23 | unicode_input_start(); 24 | register_hex(keycode & 0x7FFF); 25 | unicode_input_finish(); 26 | } 27 | return true; 28 | } 29 | -------------------------------------------------------------------------------- /quantum/rgb_matrix_runners/effect_runner_reactive.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED 4 | 5 | typedef HSV (*reactive_f)(HSV hsv, uint16_t offset); 6 | 7 | bool effect_runner_reactive(effect_params_t* params, reactive_f effect_func) { 8 | RGB_MATRIX_USE_LIMITS(led_min, led_max); 9 | 10 | uint16_t max_tick = 65535 / rgb_matrix_config.speed; 11 | for (uint8_t i = led_min; i < led_max; i++) { 12 | RGB_MATRIX_TEST_LED_FLAGS(); 13 | uint16_t tick = max_tick; 14 | // Reverse search to find most recent key hit 15 | for (int8_t j = g_last_hit_tracker.count - 1; j >= 0; j--) { 16 | if (g_last_hit_tracker.index[j] == i && g_last_hit_tracker.tick[j] < tick) { 17 | tick = g_last_hit_tracker.tick[j]; 18 | break; 19 | } 20 | } 21 | 22 | uint16_t offset = scale16by8(tick, rgb_matrix_config.speed); 23 | RGB rgb = rgb_matrix_hsv_to_rgb(effect_func(rgb_matrix_config.hsv, offset)); 24 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); 25 | } 26 | return led_max < DRIVER_LED_TOTAL; 27 | } 28 | 29 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED 30 | -------------------------------------------------------------------------------- /tmk_core/common/webusb.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #ifndef FIRMWARE_VERSION 7 | #define FIRMWARE_VERSION u8"default" 8 | #endif 9 | #define WEBUSB_STOP_BIT -2 10 | #define WEBUSB_BLINK_STEPS 512 11 | #define WEBUSB_BLINK_END WEBUSB_BLINK_STEPS * 60 12 | 13 | void webusb_receive(uint8_t *data, uint8_t length); 14 | void webusb_send(uint8_t *data, uint8_t length); 15 | void webusb_layer_event(void); 16 | void webusb_error(uint8_t code); 17 | void webusb_set_pairing_state(void); 18 | bool webusb_receive_quantum(uint8_t *data, uint8_t length); 19 | 20 | typedef struct{ 21 | bool paired; 22 | bool pairing; 23 | } webusb_state_t; 24 | 25 | extern webusb_state_t webusb_state; 26 | 27 | enum Webusb_Status_Code { 28 | WEBUSB_STATUS_NOT_PAIRED = -1, 29 | WEBUSB_STATUS_OK, 30 | WEBUSB_STATUS_UNKNOWN_COMMAND, 31 | WEBUSB_STATUS_SAFE_RANGE, 32 | }; 33 | 34 | enum Webusb_Command_Code { 35 | WEBUSB_CMD_PAIR, 36 | WEBUSB_CMD_GET_FW_VERSION, 37 | WEBUSB_CMD_SAFE_RANGE, 38 | 39 | }; 40 | 41 | enum Webusb_Event_Code { 42 | WEBUSB_EVT_PAIRED, 43 | WEBUSB_EVT_FW_VERSION, 44 | WEBUSB_EVT_SAFE_RANGE, 45 | 46 | }; 47 | -------------------------------------------------------------------------------- /tmk_core/protocol/usb_hid/arduino-1.0.1/variants/eightanaloginputs/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | pins_arduino.h - Pin definition functions for Arduino 3 | Part of Arduino - http://www.arduino.cc/ 4 | 5 | Copyright (c) 2007 David A. Mellis 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | 22 | $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $ 23 | */ 24 | 25 | #include "../standard/pins_arduino.h" 26 | #undef NUM_ANALOG_INPUTS 27 | #define NUM_ANALOG_INPUTS 8 28 | -------------------------------------------------------------------------------- /tmk_core/common/chibios/chibios_config.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 2 | * 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | #pragma once 17 | 18 | #if defined(STM32F1XX) 19 | # define USE_GPIOV1 20 | #endif 21 | 22 | #if defined(STM32F1XX) || defined(STM32F2XX) || defined(STM32F4XX) || defined(STM32L1XX) 23 | # define USE_I2CV1 24 | #endif 25 | 26 | // teensy 27 | #if defined(K20x) || defined(KL2x) 28 | # define USE_I2CV1 29 | # define USE_I2CV1_CONTRIB // for some reason a bunch of ChibiOS-Contrib boards only have clock_speed 30 | # define USE_GPIOV1 31 | #endif 32 | -------------------------------------------------------------------------------- /quantum/dip_switch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Jack Humbert 3 | * Copyright 2018 Drashna Jaelre (Christopher Courtney) 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "quantum.h" 22 | 23 | void dip_switch_update_kb(uint8_t index, bool active); 24 | void dip_switch_update_user(uint8_t index, bool active); 25 | void dip_switch_update_mask_user(uint32_t state); 26 | void dip_switch_update_mask_kb(uint32_t state); 27 | 28 | void dip_switch_init(void); 29 | void dip_switch_read(bool forced); 30 | -------------------------------------------------------------------------------- /lib/python/qmk/cli/generate/docs.py: -------------------------------------------------------------------------------- 1 | """Build QMK documentation locally 2 | """ 3 | import shutil 4 | import subprocess 5 | from pathlib import Path 6 | 7 | from milc import cli 8 | 9 | DOCS_PATH = Path('docs/') 10 | BUILD_PATH = Path('.build/docs/') 11 | 12 | 13 | @cli.subcommand('Build QMK documentation.', hidden=False if cli.config.user.developer else True) 14 | def generate_docs(cli): 15 | """Invoke the docs generation process 16 | 17 | TODO(unclaimed): 18 | * [ ] Add a real build step... something static docs 19 | """ 20 | 21 | if BUILD_PATH.exists(): 22 | shutil.rmtree(BUILD_PATH) 23 | 24 | shutil.copytree(DOCS_PATH, BUILD_PATH) 25 | 26 | # When not verbose we want to hide all output 27 | args = {'check': True} 28 | if not cli.args.verbose: 29 | args.update({'stdout': subprocess.DEVNULL, 'stderr': subprocess.STDOUT}) 30 | 31 | cli.log.info('Generating internal docs...') 32 | 33 | # Generate internal docs 34 | subprocess.run(['doxygen', 'Doxyfile'], **args) 35 | subprocess.run(['moxygen', '-q', '-a', '-g', '-o', BUILD_PATH / 'internals_%s.md', 'doxygen/xml'], **args) 36 | 37 | cli.log.info('Successfully generated internal docs to %s.', BUILD_PATH) 38 | --------------------------------------------------------------------------------