mirror of
https://github.com/zsa/qmk_firmware.git
synced 2026-05-04 14:55:29 +00:00
Additional updates for firmware25 (#411)
* add 75_(ansi|iso) Community Layouts to mechlovin/olly/octagon (#22459) * expand mechlovin/olly/octagon * Update info.json * Rename info.json to keyboard.json * correct matrix position for key * remove VIA * [Core] get_keycode_string(): function to format keycodes as strings, for more readable debug logging. (#24787) * keycode_string(): Format keycodes as strings. This adds the `keycode_string()` function described in https://getreuer.info/posts/keyboards/keycode-string/index.html as a core feature. * Fix formatting. * keycode_string review revisions. * Rename keycode_string() -> get_keycode_string() for consistency with existing string utils like get_u8_str(). * Revise custom keycode names with separate _user and _kb tables. * Correct indent in builddefs/generic_features.mk. Co-authored-by: Ryan <fauxpark@gmail.com> * Add KC_NUHS, KC_NUBS, and KC_CAPS. * Fix linking error with custom names. * Attempt at simplifying interface. * Formatting fix. * Several fixes and revisions. * Don't use PSTR in KEYCODE_STRING_NAME, since this fails to build on AVR. Store custom names in RAM. * Revise the internal table of common keycode names to use its own storage representation, still in PROGMEM, and now more efficiently stored flat in 8 bytes per entry. * Support Swap Hands keycodes and a few other keycodes. * Revert "Formatting fix." This reverts commit 2a2771068c7ee545ffac4103aa07e847a9ec3816. * Revert "Attempt at simplifying interface." This reverts commit 8eaf67de76e75bc92d106a8b0decc893fbc65fa5. * Simplify custom names API by sigprof's suggestion. * Support more keycodes. * Add QK_LOCK keycode. * Add Secure keycodes. * Add Joystick keycodes. * Add Programmable Button keycodes. * Add macro MC_ keycodes. * For remaining keys in known code ranges, stringify them as "QK_<feature>+<number>". For instance, "QK_MIDI+7". * Bug fix and a few improvements. * Fix missing right-hand bit when displaying 5-bit mods numerically. * Support KC_HYPR, KC_MEH, HYPR_T(kc), MEH_T(kc). * Exclude one-shot keycodes when NO_ACTION_ONESHOT is defined. --------- Co-authored-by: Ryan <fauxpark@gmail.com> * Align to latest CLI dependencies (#24553) * Align to latest CLI dependencies * Update docs * Add Community Layout support to daskeyboard4 (#23884) add ansi CL * Add the plywrks ply8x hotswap variant. (#23558) * Add hotswap variant * Update RGB matrix * Move files around to target develop * Revert rules.mk for keyboards/jaykeeb/joker/rules.mk * Update keyboards/plywrks/ply8x/hotswap/keyboard.json Co-authored-by: Drashna Jaelre <drashna@live.com> * Apply suggestions from code review Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com> * Add missing community layouts * Delete keyboards/plywrks/ply8x/rules.mk * Update missing keys in RGB matrix * Add missing key in RGB matrix for hotswap ver * Remove via keymaps * Add keyboard alias for plywrks/ply8x to plywrks/ply8x/solder * Fix typo * Fix another typo --------- Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com> * [Core] use `keycode_string` in unit tests (#25042) * tests: use keycode_string feature With a proper keycode to string implementation in qmk there is no need to use the unit tests only implementation anymore. Signed-off-by: Stefan Kerkmann <karlk90@pm.me> * tests: remove keycode_util feature This feature is no longer used as we switched the tests to the keycode string implementation. Signed-off-by: Stefan Kerkmann <karlk90@pm.me> * Non-volatile memory data repository pattern (#24356) * First batch of eeconfig conversions. * Offset and length for datablocks. * `via`, `dynamic_keymap`. * Fix filename. * Commentary. * wilba leds * satisfaction75 * satisfaction75 * more keyboard whack-a-mole * satisfaction75 * omnikeyish * more whack-a-mole * `generic_features.mk` to automatically pick up nvm repositories * thievery * deferred variable resolve * whitespace * convert api to structs/unions * convert api to structs/unions * convert api to structs/unions * fixups * code-side docs * code size fix * rollback * nvm_xxxxx_erase * Updated location of eeconfig magic numbers so non-EEPROM nvm drivers can use them too. * Fixup build. * Fixup compilation error with encoders. * Build fixes. * Add `via_ci` keymap to onekey to exercise VIA bindings (and thus dynamic keymap et.al.), fixup compilation errors based on preprocessor+sizeof. * Build failure rectification. * Migrate remaining `split.soft_serial_pin` to `split.serial.pin` (#25046) * Migrate keyboards/bastardkb * Migrate keyboards/handwired * Migrate keyboards/helix * Fix duplicate serial key * Fix outdated GPIO control function usage (#25060) * [Modules] Provide access to current path in `rules.mk`. (#25061) * Update keymap for keycult 1800 (#25070) Update keymap Co-authored-by: yiancar <yiancar@gmail.com> * Add handwired/erikpeyronson/erkbd (#25030) Co-authored-by: Erik Peyronson <erik.peyronson@gmail.com> Co-authored-by: jack <jack@pngu.org> Co-authored-by: Drashna Jaelre <drashna@live.com> * Add support for Starry FRL (#24626) Co-authored-by: jack <jack@pngu.org> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com> * Add "Large Lad" keyboard (#24727) Co-authored-by: jack <jack@pngu.org> * Bump vite from 5.4.12 to 5.4.15 in /builddefs/docsgen (#25065) Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.12 to 5.4.15. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v5.4.15/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v5.4.15/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Allow AnnePro2 to reboot (#24886) Without this, the QK_REBOOT key did nothing. * Fix path typo related RP2040 (#25069) Fix path typo * Update onekey example for nucleo f446re (#25067) * use accessible pins for nucleo f446re onekey example * remove pin collision with matrix in keyboard.json * use accessible pins for LED * remove pin collision with matrix * Update readme.md to reflect pin changes * Module documentation typo correction (#25073) * Fix lockups on AVR with `qmk/hello_world` module (#25074) Fix lockups on AVR. * At101ish (#25072) * Dell AT101 replacement pcb support * Update keyboards/at101ish/readme.md Co-Authored-By: fauxpark <fauxpark@gmail.com> * remove empty src clause in makefile * feature: Update at101ish to qmk v0.28 * feature: Add osdetecting keymap variant. * refactor: Move at101ish keyboard to handwired folder. * fix: Adjust at101ish readme- * fix: review changes. * chore: Remove unneeded feature. --------- Co-authored-by: fauxpark <fauxpark@gmail.com> * Add "license" field to Community Module JSON schema. (#25085) Add "license" field to community module schema. * Add kt60HS-T v2 PCB (#25080) * Add kt60HS-Tv2 * Update keyboards/keyten/kt60hs_t/readme.md Co-authored-by: Sergey Vlasov <sigprof@gmail.com> * Update keyboards/keyten/kt60hs_t/v1/readme.md Co-authored-by: Sergey Vlasov <sigprof@gmail.com> * Update keyboards/keyten/kt60hs_t/v2/keyboard.json Co-authored-by: Sergey Vlasov <sigprof@gmail.com> * Update keyboards/keyten/kt60hs_t/v2/readme.md Co-authored-by: Sergey Vlasov <sigprof@gmail.com> * Update keyboards/keyten/kt60hs_t/info.json Co-authored-by: Sergey Vlasov <sigprof@gmail.com> * Change of structure * Moving the keyboard * Update data/mappings/keyboard_aliases.hjson Co-authored-by: Sergey Vlasov <sigprof@gmail.com> * Update keyboards/keyten/kt60hs_t/v1/keyboard.json Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com> * Update keyboards/keyten/kt60hs_t/v2/keyboard.json Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com> --------- Co-authored-by: Sergey Vlasov <sigprof@gmail.com> Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com> * Make sure that unit tests run on all release versions * [ErgoDox EZ] Fix complication issues due to updates * [ErgoDox EZ] Fix compilication errors and warnings We want all green! * Fix 'qmk lint -kb' argument handling (#25093) * Refactor Deemen17 Works DE60 (#25088) * Add Coban Pad 12A (#25039) Co-authored-by: jack <jack@pngu.org> * [Keyboard] Add PHDesign PH60/Multi Keyboard PCB (#25086) * Add PH60/Multi Support * Add PCB PIcture for README * Remove MO(_FN2) * README Typo Fix * Layout and README Adjustment * Add README for PHDesign Main Folder * Keymap Improvement * Update README.md * [Keyboard] Add Ortho Slayer (#25099) * Add Ortho Slayer * Update keyboards/keyten/ortho_slayer/keymaps/default/keymap.c Co-authored-by: jack <jack@pngu.org> * Update keyboards/keyten/ortho_slayer/readme.md Co-authored-by: jack <jack@pngu.org> --------- Co-authored-by: jack <jack@pngu.org> * Fix coban pad9a wrong layout in keyboard.json (#25100) * Remove `CTPC`/`CONVERT_TO_PROTON_C` options (#25111) * Remove direct docs.qmk.fm links from docs (#25113) * Add warning when deprecated 'promicro_rp2040' is used (#25112) * Add Vida to QMK (#24225) Co-authored-by: jack <jack@pngu.org> Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com> * More Windows->Unix style path fixes. (#25119) * Include `math.h` where necessary. (#25122) * Cater for use of `__errno_r()` in ChibiOS syscalls.c with newer picolibc revisions (#25121) * chore: Allow disabling underglow on Work Louder devices (#25123) (#25120) * Allow disabling Underglow on Work Louder devices Allows disabling Underglow on Work Louder devices by using `RGBLIGHT_ENABLE = no` on rules.mk * Update keyboards/work_louder/rgb_functions.c Suggested by @zvecr on review. Co-authored-by: Joel Challis <git@zvecr.com> --------- Co-authored-by: Joel Challis <git@zvecr.com> * Exclude external userspace from lint checking (#24680) * fix: Fix startup sound for Preonic (#25132) (#25133) Add `AUDIO_INIT_DELAY ` to config.h to resolve * New standard layout for Savage65 (65_ansi_blocker_tsangan_split_bs) (#24690) * Added a default firmware and layout for the WindStudio Wind X R1 keyboard. * Wind X R1: cleaned-up the folders to make clear that this firmware is for the release 1 of this keyboard. * Delete keyboards/windstudio/wind_x/R1 directory Removing the uppercase R1 folder * feat(cannonkeys/savage65): Added layout to keyboard.json - Added the layout LAYOUT_65_ansi_blocker_tsangan_split_bs to the community layouts. * kradoindustries_promenade: add LAYOUT_1x2u (#25090) * Update shuguet/shu89 (#24780) * Update keyboard.json Update mod keys location in RGB layout. * Update keyboard.json * Update keyboards/shuguet/shu89/keyboard.json Co-authored-by: Ryan <fauxpark@gmail.com> --------- Co-authored-by: Ryan <fauxpark@gmail.com> * [Keyboard] Add suika83opti (#24991) * [chore]: move and rename mouse/scroll min/max defines (#25141) * protocol: move {XY/HV}_REPORT_{MIN,MAX} into report.h ..to allow easier re-use in other code implementations. * protocol: rename {XY/HV}_REPORT_{MIN/MAX} to MOUSE_REPORT_{XY/HV}_{MIN/MAX} ..to avoid naming collisions. * [Core] Flow Tap tap-hold option to disable HRMs during fast typing (#25125) aka Global Quick Tap, Require Prior Idle * Add Link keyboard (#25058) Co-authored-by: jack <jack@pngu.org> Co-authored-by: Drashna Jaelre <drashna@live.com> * Remove Sofle `rgb_default` keymap & tidy readme's (#25010) * Added Keyboard LumPy27 (#24967) Co-authored-by: jack <jack@pngu.org> Co-authored-by: Drashna Jaelre <drashna@live.com> * [Keyboard] Kobold r1 (#25161) * Kobold r1 * Apply suggestions from code review Co-authored-by: jack <jack@pngu.org> * `board_init` => `early_hardware_init_post`. --------- Co-authored-by: jack <jack@pngu.org> * [Docs] Unify lighting step descriptions (#25167) unify lighting step descriptions and defaults across docs * [Keyboard] Add voidhhkb-hotswap (#25007) * Added files for voidhhkb-hotswap * Updated keyboard name to resolve build errors * Implement suggestions from PR. Use 60_hhkb community layout. * Update keyboards/void/voidhhkb_hotswap/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Apply suggestions from code review Co-authored-by: jack <jack@pngu.org> --------- Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: jack <jack@pngu.org> * Remove duplication of RGB Matrix defaults (#25146) * Remove duplication of RGB Matrix defaults * Remove more duplication of defaults * fix * Fix missing and extra commas in JSON schema (#25057) * Remove duplication of RGBLight defaults (#25169) * Ignore the Layer Lock key in Repeat Key and Caps Word. (#25171) * Allow for disabling EEPROM subsystem entirely. (#25173) * [keyboard] ymdk/id75/rp2040 (#25157) Co-authored-by: tao heihei <> * Remove `bluefruit_le_read_battery_voltage` function (#25129) * Fix 'Would you like to clone the submodules?' prompt under msys (#24958) * Fixup eeconfig lighting reset. (#25166) * DOCS: `qmk-hid` missing in bootloaders list? (#25177) * Fix for `.clangd`. (#25180) * Update develop branch to Pico SDK 1.5.1 (#25178) * Add lint warning for empty url (#25182) * Implement connection keycode logic (#25176) * Add handwired/footy (#25151) Co-authored-by: jack <jack@pngu.org> * Decrease firmware size for `anavi/macropad8`. (#25185) Preparation for bootstrapper. * Align ChibiOS `USB_WAIT_FOR_ENUMERATION` implementation (#25184) * [Bug][Core] Fix for Flow Tap: fix handling of distinct taps and timer updates. (#25175) * Flow Tap bug fix. As reported by @amarz45 and @mwpardue, there is a bug where if two tap-hold keys are pressed in distinct taps back to back, then Flow Tap is not applied on the second tap-hold key, but it should be. In a related bug reported by @NikGovorov, if a tap-hold key is held followed by a tap of a tap-hold key, then Flow Tap updates its timer on the release of the held tap-hold key, but it should be ignored. The problem common to both these bugs is that I incorrectly assumed `tapping_key` is cleared to noevent once it is released, when actually `tapping_key` is still maintained for `TAPPING_TERM` ms after release (for Quick Tap). This commit fixes that. Thanks to @amarz45, @mwpardue, and @NikGovorov for reporting! Details: * Logic for converting the current tap-hold event to a tap is extracted to `flow_tap_key_if_within_term()`, which is now invoked also in the post-release "interfered with other tap key" case. This fixes the distinct taps bug. * The Flow Tap timer is now updated at the beginning of each call to `process_record()`, provided that there is no unsettled tap-hold key at that time and that the record is not for a mod or layer switch key. By moving this update logic to `process_record()`, it is conceptually simpler and more robust. * Unit tests extended to cover the reported scenarios. * Fix formatting. * Revision to fix @NikGovorov's scenario. The issue is that when another key is pressed while a layer-tap hasn't been settled yet, the `prev_keycode` remembers the keycode from before the layer switched. This can then enable Flow Tap for the following key when it shouldn't, or vice versa. Thanks to @NikGovorov for reporting! This commit revises Flow Tap in the following ways: * The previous key and timer are both updated from `process_record()`. This is slightly later in the sequence of processing than before, and by this point, a just-settled layer-tap should have taken effect so that the keycode from the correct layer is remembered. * The Flow Tap previous key and timer are updated now also on key release events, except for releases of modifiers and held layer switches. * The Flow Tap previous key and timer are now updated together, for simplicity. This makes the logic easier to think about. * A few additional unit tests, including @NikGovorov's scenario as "layer_tap_ignored_with_disabled_key_complex." * Remove empty `url` fields (#25181) * Prompt for converter when creating new keymap (#25116) * High resolution scrolling (without feature report parsing) (#24423) * hires scrolling without feature report parsing * fix valid range for exponent * fix incorrect minimum exponent value documentation * Avoid duplication in generated community modules `rules.mk` (#25135) * Bump rlespinasse/github-slug-action from 3 to 5 (#25021) * Remove `"console":false` from keyboards (#25190) * Update 'qmk generate-api' to only publish pure DD keymaps (#24782) * Remove more duplication of defaults (#25189) * Align `new-keyboard` template to current standards (#25191) * Bump vite from 5.4.15 to 5.4.18 in /builddefs/docsgen (#25192) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix `boardsource/beiwagon` RGB Matrix coordinates (#25018) * Remove `"command":false` from keyboards (#25193) * Extend lint checks to reject duplication of defaults (#25149) * modelh: add prerequisites for via support (#24932) * First TypeK support (#22876) * Add Lemokey X0 keyboard (#24994) * keyboards/annepro2/ld: Add per-variant linker scripts (#24999) C18 has an MCU with 16K SRAM, up from C15's 8K. Split the linker script into C15 and C18 variants to make use of the larger RAM capacity of C18. * Add new keyboard MirageiX (#25054) Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: jack <0x6a73@protonmail.com> * [Keymap] Sofle RGB - fixed stuck on numpad layer and layout comments (#24942) * Add handwired 4x14 LuMaWing keyboard (#24885) * Add jcpm2 (JC Pro Macro 2) (#24816) Co-authored-by: jack <jack@pngu.org> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Joel Challis <git@zvecr.com> * [Keyboard] Add splitkb.com's Halcyon Elora rev2 (#24790) Co-authored-by: Drashna Jaelre <drashna@live.com> * [Keyboard] mzmkb/slimdash/rev1 (#24804) Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: jack <jack@pngu.org> Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com> Co-authored-by: Ryan <fauxpark@gmail.com> * Added new keyboard epssp75 (#24756) Co-authored-by: Drashna Jaelre <drashna@live.com> * Addition of OK-1 (#24646) Co-authored-by: Joel Challis <git@zvecr.com> Co-authored-by: Drashna Jaelre <drashna@live.com> * Add Umbra keyboard (#24569) Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com> Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Drashna Jaelre <drashna@live.com> * Amptrics 0420 keyboard addition (#24744) Co-authored-by: jack <jack@pngu.org> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com> * [Core] Enhance Flow Tap to work better for rolls over multiple tap-hold keys. (#25200) * Flow Tap revision for rolling press. * Remove debugging cruft. * Formatting fix. * amptrics/0422 - Prevent OOB in `update_leds_for_layer` (#25209) * [Keyboard] Add Gravity-45(#25206) * add gravity-45 * readme.md * fix readme * Update keyboards/green_keys/gravity_45/keyboard.json Co-authored-by: jack <0x6a73@protonmail.com> * run qmk format-json -i keyboards/green_keys/gravity_45/keyboard.json * add url * Update keyboards/green_keys/gravity_45/keyboard.json Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com> * Update keyboard.json * Update keyboard.json * Update keyboards/green_keys/gravity_45/keyboard.json Co-authored-by: Drashna Jaelre <drashna@live.com> --------- Co-authored-by: jack <0x6a73@protonmail.com> Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com> Co-authored-by: Drashna Jaelre <drashna@live.com> * Remove redundant keyboard headers (#25208) * Fix Spleeb compile when pointing device is enabled (#25016) * [Bug] Minimise force-included files (#25194) * Add additional hooks for Community modules (#25050) * Workaround for resolving keyboard alias for config file values (#25228) * Generate versions to keycode headers (#25219) * Resolve alias for `qmk new-keymap` keyboard prompts (#25210) * [Keyboard] Add Binepad KN01 (#25224) * Add Binepad NeoKnob KN01 * post @waffle87 recommendations * Add battery changed callbacks (#25207) * Ensure `qmk_userspace_paths` maintains detected order (#25204) * Bind Bluetooth driver to `host_driver_t` (#25199) * Deprecate `qmk generate-compilation-database`. (#25237) * Remove force disable of NKRO when Bluetooth enabled (#25201) * Keycult 60 (#25213) Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com> Co-authored-by: jack <jack@pngu.org> * [Keyboard] Add Binepad KnobX1 (#25222) Co-authored-by: Drashna Jaelre <drashna@live.com> * [Keyboard] Update Tractyl Manuform and add F405 (weact) variant (#24764) * Layout corrections: Zed60 (#25003) * Fixed print statement after enabling 32-bit layers (#25027) * Fix Aurora sweep default keymap configuration (#25148) * Docs update for installing qmk with uv (#24995) * CXT Studio 12E3: Fix encoder resolutions not applying (#25242) * add resolution to encoders so they apply * Tweak default keymap * replace KC_UNDO with C(KC_Z) as well * Add debounce to duplicated defaults check (#25246) * [Docs] Fix typos introduced by PR #25050 (#25250) It isn't a drashna PR if there aren't some typos in it somewhere. * Allow LVGL onekey keymap to be able compile for other board (#25005) * [Keyboard] Add Jason Hazel’s Bad Wings v2 (#25252) Co-authored-by: Florent Allard <florent.allard@savoirfairelinux.com> * Add raw_hid support to host driver (#25255) * Fix Wear Leveling compilation (#25254) * [New Feature/Core] New RGB Matrix Animation "Starlight Smooth" (#25203) * Enable community modules to define LED matrix and RGB matrix effects. (#25187) Co-authored-by: Joel Challis <git@zvecr.com> * Fix OS_DETECTION_KEYBOARD_RESET (#25015) Co-authored-by: Nick Brassel <nick@tzarc.org> * Fixes the numlock indicator for Magic Force MF17 numpad (#25260) * Add Harite v2 keyboard (#24975) * dlip/haritev2 - Post merge fixes (#25264) * Remove more USB only branches from NKRO handling (#25263) * Deprecate `usb.force_nkro`/`FORCE_NKRO` (#25262) * Add BDN9 Rev. 3 (#25261) * Remove duplicate of SPI default config from keyboards (#25266) * Resolve miscellaneous keyboard lint warnings (#25268) * Add Zeropad (#24737) Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Joel Challis <git@zvecr.com> * Add Waveshare RP2040-Keyboard-3 support (#25269) * Update PR checklist notes on custom matrix (#25240) * Chew folders (#24785) * gcc15 AVR compilation fixes (#25238) * [Core] STM32G0x1 support (#24301) * Use relative paths for schemas, instead of $id. Enables VScode validation. (#25251) * add doio/kb03 (#24815) Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Joel Challis <git@zvecr.com> * Move rookiebwoy to ivndbt (#25142) * [Chore] use {rgblight,rgb_matrix}_hsv_to_rgb overrides (#25271) * Remove outdated `nix` support due to bit-rot. (#25280) * Add `compiler_support.h` (#25274) * Configure boards to use development_board - 0-9 (#25287) * [Fix] lib8tion: enable fixed scale8 and blend functions (#25272) lib8tion: enable fixed scale8 and blend functions These FastLED derived lib8tion functions have been fixed and enabled by default in FastLED. QMK just never set these defines, there is no reason to keep the buggy implementation. It is assumed that nobody relied on the buggy behavior. * Configure boards to use development_board - UVWXYZ (#25288) * [Docs] Fix tap_hold code blocks (#25298) * salicylic_acid3/getta25 - Fix oled keymap (#25295) * Configure boards to use development_board - S (#25293) * Configure boards to use development_board - T (#25294) * 2025 Q2 changelog (#25297) Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Nick Brassel <nick@tzarc.org> * Update Oryx module for newer code * Soft reset matrix * Use improved i2c reset for voyager and moonlander matrix * Fix formatting * Remove labeler action (unneeded) * Fix module API version for Oryx module * Use i2cStop instead of trying to work around --------- Signed-off-by: Stefan Kerkmann <karlk90@pm.me> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com> Co-authored-by: QMK Bot <hello@qmk.fm> Co-authored-by: Pascal Getreuer <50221757+getreuer@users.noreply.github.com> Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Joel Challis <git@zvecr.com> Co-authored-by: Ramon Imbao <ramonimbao@gmail.com> Co-authored-by: Stefan Kerkmann <karlk90@pm.me> Co-authored-by: Nick Brassel <nick@tzarc.org> Co-authored-by: jack <jack@pngu.org> Co-authored-by: yiancar <yiangosyiangou@cytanet.com.cy> Co-authored-by: yiancar <yiancar@gmail.com> Co-authored-by: Erik Peyronson <erikpeyronson@gmail.com> Co-authored-by: Erik Peyronson <erik.peyronson@gmail.com> Co-authored-by: Sắn <59417802+MaiTheSan@users.noreply.github.com> Co-authored-by: Hyphen-ated <Hyphen-ated@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Geoffrey Frogeye <s+github@frogeye.fr> Co-authored-by: lsh4711 <120231876+lsh4711@users.noreply.github.com> Co-authored-by: Ben Green <bengreen.uk@gmail.com> Co-authored-by: フィルターペーパー <76888457+filterpaper@users.noreply.github.com> Co-authored-by: henrikosorensen <henrik.sorensen@gmail.com> Co-authored-by: Ivan Gromov <38141348+key10iq@users.noreply.github.com> Co-authored-by: Sergey Vlasov <sigprof@gmail.com> Co-authored-by: Pham Duc Minh <95753855+Deemen17@users.noreply.github.com> Co-authored-by: Dam Vu Duy <RyanDam@users.noreply.github.com> Co-authored-by: nonameCCC <79012391+nonameCCC@users.noreply.github.com> Co-authored-by: sudo pacman -Syu <hauvipapro@gmail.com> Co-authored-by: Andrew Kannan <andrew.kannan@gmail.com> Co-authored-by: Luis Garcia <luis@bitjester.com> Co-authored-by: Christian C. Berclaz <christian.berclaz@mac.com> Co-authored-by: Olivier Mehani <shtrom-github@ssji.net> Co-authored-by: Sylvain Huguet <sylvain@huguet.me> Co-authored-by: suikagiken <115451678+suikagiken@users.noreply.github.com> Co-authored-by: Daniel Reisch <danieljreisch@gmail.com> Co-authored-by: ClownFish <177758267+clownfish-og@users.noreply.github.com> Co-authored-by: JamesWilson1996 <47866504+JamesWilson1996@users.noreply.github.com> Co-authored-by: Less/Rikki <86894501+lesshonor@users.noreply.github.com> Co-authored-by: Jan Bláha <blaha.j502@gmail.com> Co-authored-by: Eric Molitor <534583+emolitor@users.noreply.github.com> Co-authored-by: CJ Pais <cj@cjpais.com> Co-authored-by: eynsai <47629346+eynsai@users.noreply.github.com> Co-authored-by: Joel Beckmeyer <joel@beckmeyer.us> Co-authored-by: Álvaro A. Volpato <alvaro.augusto.volpato@gmail.com> Co-authored-by: Aidan Gauland <aidalgol@users.noreply.github.com> Co-authored-by: Michał Kopeć <michal@nozomi.space> Co-authored-by: takashicompany <t@kashi.company> Co-authored-by: jack <0x6a73@protonmail.com> Co-authored-by: Matheus Marques <matheusmbar@gmail.com> Co-authored-by: LucasMateijsen <l.mateijsen@outlook.com> Co-authored-by: Jeremy Cook <jscook55@gmail.com> Co-authored-by: VeyPatch <126267034+VeyPatch@users.noreply.github.com> Co-authored-by: mizma <omoikane@path-works.net> Co-authored-by: hen-des <141591967+hen-des@users.noreply.github.com> Co-authored-by: Cipulot <40441626+Cipulot@users.noreply.github.com> Co-authored-by: josephawilliamsiv <31166673+josephawilliamsiv@users.noreply.github.com> Co-authored-by: vchowl <vchowl@outlook.com> Co-authored-by: Christopher Hoage <iam@chrishoage.com> Co-authored-by: Silvino R. <366673+silvinor@users.noreply.github.com> Co-authored-by: dabstractor <dustindschultz@gmail.com> Co-authored-by: Nathan Cain <13713501+nathanscain@users.noreply.github.com> Co-authored-by: muge <221161+muge@users.noreply.github.com> Co-authored-by: HorrorTroll <sonicvipduc@gmail.com> Co-authored-by: cyxae <cyxae@amphitryon.nrst.fr> Co-authored-by: Florent Allard <florent.allard@savoirfairelinux.com> Co-authored-by: art-was-here <mail@buckles.email> Co-authored-by: Matti Hiljanen <170205+qvr@users.noreply.github.com> Co-authored-by: Wasteland Fluttershy <ingvardm@gmail.com> Co-authored-by: Dane Lipscombe <danelipscombe@gmail.com> Co-authored-by: Danny <nooges@users.noreply.github.com> Co-authored-by: Infos <136488157+diffrentGuesser@users.noreply.github.com> Co-authored-by: Florent Linguenheld <f@linguenheld.fr> Co-authored-by: ivan <81021475+ivndbt@users.noreply.github.com> Co-authored-by: Pablo Martínez <58857054+elpekenin@users.noreply.github.com>
This commit is contained in:
@@ -281,6 +281,9 @@ void process_record(keyrecord_t *record) {
|
||||
if (IS_NOEVENT(record->event)) {
|
||||
return;
|
||||
}
|
||||
#ifdef FLOW_TAP_TERM
|
||||
flow_tap_update_last_event(record);
|
||||
#endif // FLOW_TAP_TERM
|
||||
|
||||
if (!process_record_quantum(record)) {
|
||||
#ifndef NO_ACTION_ONESHOT
|
||||
@@ -1183,6 +1186,23 @@ bool is_tap_action(action_t action) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint16_t get_tap_keycode(uint16_t keycode) {
|
||||
switch (keycode) {
|
||||
case QK_MOD_TAP ... QK_MOD_TAP_MAX:
|
||||
return QK_MOD_TAP_GET_TAP_KEYCODE(keycode);
|
||||
case QK_LAYER_TAP ... QK_LAYER_TAP_MAX:
|
||||
return QK_LAYER_TAP_GET_TAP_KEYCODE(keycode);
|
||||
case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX:
|
||||
// IS_SWAP_HANDS_KEYCODE() tests for the special action keycodes
|
||||
// like SH_TOGG, SH_TT, ..., which overlap the SH_T(kc) range.
|
||||
if (!IS_SWAP_HANDS_KEYCODE(keycode)) {
|
||||
return QK_SWAP_HANDS_GET_TAP_KEYCODE(keycode);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return keycode;
|
||||
}
|
||||
|
||||
/** \brief Debug print (FIXME: Needs better description)
|
||||
*
|
||||
* FIXME: Needs documentation.
|
||||
|
||||
@@ -128,6 +128,12 @@ void layer_switch(uint8_t new_layer);
|
||||
bool is_tap_record(keyrecord_t *record);
|
||||
bool is_tap_action(action_t action);
|
||||
|
||||
/**
|
||||
* Given an MT or LT keycode, returns the tap keycode. Otherwise returns the
|
||||
* original keycode unchanged.
|
||||
*/
|
||||
uint16_t get_tap_keycode(uint16_t keycode);
|
||||
|
||||
#ifndef NO_ACTION_TAPPING
|
||||
void process_record_tap_hint(keyrecord_t *record);
|
||||
#endif
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
#include "action.h"
|
||||
#include "action_layer.h"
|
||||
#include "action_tapping.h"
|
||||
#include "action_util.h"
|
||||
#include "keycode.h"
|
||||
#include "quantum_keycodes.h"
|
||||
#include "timer.h"
|
||||
|
||||
#ifndef NO_ACTION_TAPPING
|
||||
@@ -49,9 +51,7 @@ __attribute__((weak)) bool get_permissive_hold(uint16_t keycode, keyrecord_t *re
|
||||
}
|
||||
# endif
|
||||
|
||||
# if defined(CHORDAL_HOLD)
|
||||
extern const char chordal_hold_layout[MATRIX_ROWS][MATRIX_COLS] PROGMEM;
|
||||
|
||||
# if defined(CHORDAL_HOLD) || defined(FLOW_TAP_TERM)
|
||||
# define REGISTERED_TAPS_SIZE 8
|
||||
// Array of tap-hold keys that have been settled as tapped but not yet released.
|
||||
static keypos_t registered_taps[REGISTERED_TAPS_SIZE] = {};
|
||||
@@ -66,6 +66,14 @@ static void registered_taps_del_index(uint8_t i);
|
||||
/** Logs the registered_taps array for debugging. */
|
||||
static void debug_registered_taps(void);
|
||||
|
||||
static bool is_mt_or_lt(uint16_t keycode) {
|
||||
return IS_QK_MOD_TAP(keycode) || IS_QK_LAYER_TAP(keycode);
|
||||
}
|
||||
# endif // defined(CHORDAL_HOLD) || defined(FLOW_TAP_TERM)
|
||||
|
||||
# if defined(CHORDAL_HOLD)
|
||||
extern const char chordal_hold_layout[MATRIX_ROWS][MATRIX_COLS] PROGMEM;
|
||||
|
||||
/** \brief Finds which queued events should be held according to Chordal Hold.
|
||||
*
|
||||
* In a situation with multiple unsettled tap-hold key presses, scan the queue
|
||||
@@ -82,10 +90,6 @@ static void waiting_buffer_chordal_hold_taps_until(keypos_t key);
|
||||
|
||||
/** \brief Processes and pops buffered events until the first tap-hold event. */
|
||||
static void waiting_buffer_process_regular(void);
|
||||
|
||||
static bool is_mt_or_lt(uint16_t keycode) {
|
||||
return IS_QK_MOD_TAP(keycode) || IS_QK_LAYER_TAP(keycode);
|
||||
}
|
||||
# endif // CHORDAL_HOLD
|
||||
|
||||
# ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY
|
||||
@@ -98,6 +102,14 @@ __attribute__((weak)) bool get_hold_on_other_key_press(uint16_t keycode, keyreco
|
||||
# include "process_auto_shift.h"
|
||||
# endif
|
||||
|
||||
# if defined(FLOW_TAP_TERM)
|
||||
static uint16_t flow_tap_prev_keycode = KC_NO;
|
||||
static uint16_t flow_tap_prev_time = 0;
|
||||
static bool flow_tap_expired = true;
|
||||
|
||||
static bool flow_tap_key_if_within_term(keyrecord_t *record, uint16_t prev_time);
|
||||
# endif // defined(FLOW_TAP_TERM)
|
||||
|
||||
static keyrecord_t tapping_key = {};
|
||||
static keyrecord_t waiting_buffer[WAITING_BUFFER_SIZE] = {};
|
||||
static uint8_t waiting_buffer_head = 0;
|
||||
@@ -148,6 +160,12 @@ void action_tapping_process(keyrecord_t record) {
|
||||
}
|
||||
if (IS_EVENT(record.event)) {
|
||||
ac_dprintf("\n");
|
||||
} else {
|
||||
# ifdef FLOW_TAP_TERM
|
||||
if (!flow_tap_expired && TIMER_DIFF_16(record.event.time, flow_tap_prev_time) >= INT16_MAX / 2) {
|
||||
flow_tap_expired = true;
|
||||
}
|
||||
# endif // FLOW_TAP_TERM
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,7 +223,7 @@ void action_tapping_process(keyrecord_t record) {
|
||||
bool process_tapping(keyrecord_t *keyp) {
|
||||
const keyevent_t event = keyp->event;
|
||||
|
||||
# if defined(CHORDAL_HOLD)
|
||||
# if defined(CHORDAL_HOLD) || defined(FLOW_TAP_TERM)
|
||||
if (!event.pressed) {
|
||||
const int8_t i = registered_tap_find(event.key);
|
||||
if (i != -1) {
|
||||
@@ -217,7 +235,7 @@ bool process_tapping(keyrecord_t *keyp) {
|
||||
debug_registered_taps();
|
||||
}
|
||||
}
|
||||
# endif // CHORDAL_HOLD
|
||||
# endif // defined(CHORDAL_HOLD) || defined(FLOW_TAP_TERM)
|
||||
|
||||
// state machine is in the "reset" state, no tapping key is to be
|
||||
// processed
|
||||
@@ -227,6 +245,13 @@ bool process_tapping(keyrecord_t *keyp) {
|
||||
} else if (event.pressed && is_tap_record(keyp)) {
|
||||
// the currently pressed key is a tapping key, therefore transition
|
||||
// into the "pressed" tapping key state
|
||||
|
||||
# if defined(FLOW_TAP_TERM)
|
||||
if (flow_tap_key_if_within_term(keyp, flow_tap_prev_time)) {
|
||||
return true;
|
||||
}
|
||||
# endif // defined(FLOW_TAP_TERM)
|
||||
|
||||
ac_dprintf("Tapping: Start(Press tap key).\n");
|
||||
tapping_key = *keyp;
|
||||
process_record_tap_hint(&tapping_key);
|
||||
@@ -263,6 +288,27 @@ bool process_tapping(keyrecord_t *keyp) {
|
||||
|
||||
// copy tapping state
|
||||
keyp->tap = tapping_key.tap;
|
||||
|
||||
# if defined(FLOW_TAP_TERM)
|
||||
// Now that tapping_key has settled as tapped, check whether
|
||||
// Flow Tap applies to following yet-unsettled keys.
|
||||
uint16_t prev_time = tapping_key.event.time;
|
||||
for (; waiting_buffer_tail != waiting_buffer_head; waiting_buffer_tail = (waiting_buffer_tail + 1) % WAITING_BUFFER_SIZE) {
|
||||
keyrecord_t *record = &waiting_buffer[waiting_buffer_tail];
|
||||
if (!record->event.pressed) {
|
||||
break;
|
||||
}
|
||||
const int16_t next_time = record->event.time;
|
||||
if (!is_tap_record(record)) {
|
||||
process_record(record);
|
||||
} else if (!flow_tap_key_if_within_term(record, prev_time)) {
|
||||
break;
|
||||
}
|
||||
prev_time = next_time;
|
||||
}
|
||||
debug_waiting_buffer();
|
||||
# endif // defined(FLOW_TAP_TERM)
|
||||
|
||||
// enqueue
|
||||
return false;
|
||||
}
|
||||
@@ -538,6 +584,13 @@ bool process_tapping(keyrecord_t *keyp) {
|
||||
return true;
|
||||
} else if (is_tap_record(keyp)) {
|
||||
// Sequential tap can be interfered with other tap key.
|
||||
# if defined(FLOW_TAP_TERM)
|
||||
if (flow_tap_key_if_within_term(keyp, flow_tap_prev_time)) {
|
||||
tapping_key = (keyrecord_t){0};
|
||||
debug_tapping_key();
|
||||
return true;
|
||||
}
|
||||
# endif // defined(FLOW_TAP_TERM)
|
||||
ac_dprintf("Tapping: Start with interfering other tap.\n");
|
||||
tapping_key = *keyp;
|
||||
waiting_buffer_scan_tap();
|
||||
@@ -655,28 +708,7 @@ void waiting_buffer_scan_tap(void) {
|
||||
}
|
||||
}
|
||||
|
||||
# ifdef CHORDAL_HOLD
|
||||
__attribute__((weak)) bool get_chordal_hold(uint16_t tap_hold_keycode, keyrecord_t *tap_hold_record, uint16_t other_keycode, keyrecord_t *other_record) {
|
||||
return get_chordal_hold_default(tap_hold_record, other_record);
|
||||
}
|
||||
|
||||
bool get_chordal_hold_default(keyrecord_t *tap_hold_record, keyrecord_t *other_record) {
|
||||
if (tap_hold_record->event.type != KEY_EVENT || other_record->event.type != KEY_EVENT) {
|
||||
return true; // Return true on combos or other non-key events.
|
||||
}
|
||||
|
||||
char tap_hold_hand = chordal_hold_handedness(tap_hold_record->event.key);
|
||||
if (tap_hold_hand == '*') {
|
||||
return true;
|
||||
}
|
||||
char other_hand = chordal_hold_handedness(other_record->event.key);
|
||||
return other_hand == '*' || tap_hold_hand != other_hand;
|
||||
}
|
||||
|
||||
__attribute__((weak)) char chordal_hold_handedness(keypos_t key) {
|
||||
return (char)pgm_read_byte(&chordal_hold_layout[key.row][key.col]);
|
||||
}
|
||||
|
||||
# if defined(CHORDAL_HOLD) || defined(FLOW_TAP_TERM)
|
||||
static void registered_taps_add(keypos_t key) {
|
||||
if (num_registered_taps >= REGISTERED_TAPS_SIZE) {
|
||||
ac_dprintf("TAPS OVERFLOW: CLEAR ALL STATES\n");
|
||||
@@ -714,6 +746,30 @@ static void debug_registered_taps(void) {
|
||||
ac_dprintf("}\n");
|
||||
}
|
||||
|
||||
# endif // defined(CHORDAL_HOLD) || defined(FLOW_TAP_TERM)
|
||||
|
||||
# ifdef CHORDAL_HOLD
|
||||
__attribute__((weak)) bool get_chordal_hold(uint16_t tap_hold_keycode, keyrecord_t *tap_hold_record, uint16_t other_keycode, keyrecord_t *other_record) {
|
||||
return get_chordal_hold_default(tap_hold_record, other_record);
|
||||
}
|
||||
|
||||
bool get_chordal_hold_default(keyrecord_t *tap_hold_record, keyrecord_t *other_record) {
|
||||
if (tap_hold_record->event.type != KEY_EVENT || other_record->event.type != KEY_EVENT) {
|
||||
return true; // Return true on combos or other non-key events.
|
||||
}
|
||||
|
||||
char tap_hold_hand = chordal_hold_handedness(tap_hold_record->event.key);
|
||||
if (tap_hold_hand == '*') {
|
||||
return true;
|
||||
}
|
||||
char other_hand = chordal_hold_handedness(other_record->event.key);
|
||||
return other_hand == '*' || tap_hold_hand != other_hand;
|
||||
}
|
||||
|
||||
__attribute__((weak)) char chordal_hold_handedness(keypos_t key) {
|
||||
return (char)pgm_read_byte(&chordal_hold_layout[key.row][key.col]);
|
||||
}
|
||||
|
||||
static uint8_t waiting_buffer_find_chordal_hold_tap(void) {
|
||||
keyrecord_t *prev = &tapping_key;
|
||||
uint16_t prev_keycode = get_record_keycode(&tapping_key, false);
|
||||
@@ -761,6 +817,100 @@ static void waiting_buffer_process_regular(void) {
|
||||
}
|
||||
# endif // CHORDAL_HOLD
|
||||
|
||||
# ifdef FLOW_TAP_TERM
|
||||
void flow_tap_update_last_event(keyrecord_t *record) {
|
||||
const uint16_t keycode = get_record_keycode(record, false);
|
||||
// Don't update while a tap-hold key is unsettled.
|
||||
if (record->tap.count == 0 && (waiting_buffer_tail != waiting_buffer_head || (tapping_key.event.pressed && tapping_key.tap.count == 0))) {
|
||||
return;
|
||||
}
|
||||
// Ignore releases of modifiers and held layer switches.
|
||||
if (!record->event.pressed) {
|
||||
switch (keycode) {
|
||||
case MODIFIER_KEYCODE_RANGE:
|
||||
case QK_MOMENTARY ... QK_MOMENTARY_MAX:
|
||||
case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX:
|
||||
# ifndef NO_ACTION_ONESHOT // Ignore one-shot keys.
|
||||
case QK_ONE_SHOT_MOD ... QK_ONE_SHOT_MOD_MAX:
|
||||
case QK_ONE_SHOT_LAYER ... QK_ONE_SHOT_LAYER_MAX:
|
||||
# endif // NO_ACTION_ONESHOT
|
||||
# ifdef TRI_LAYER_ENABLE // Ignore Tri Layer keys.
|
||||
case QK_TRI_LAYER_LOWER:
|
||||
case QK_TRI_LAYER_UPPER:
|
||||
# endif // TRI_LAYER_ENABLE
|
||||
return;
|
||||
case QK_MODS ... QK_MODS_MAX:
|
||||
if (QK_MODS_GET_BASIC_KEYCODE(keycode) == KC_NO) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case QK_MOD_TAP ... QK_MOD_TAP_MAX:
|
||||
case QK_LAYER_TAP ... QK_LAYER_TAP_MAX:
|
||||
if (record->tap.count == 0) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
flow_tap_prev_keycode = keycode;
|
||||
flow_tap_prev_time = record->event.time;
|
||||
flow_tap_expired = false;
|
||||
}
|
||||
|
||||
static bool flow_tap_key_if_within_term(keyrecord_t *record, uint16_t prev_time) {
|
||||
const uint16_t idle_time = TIMER_DIFF_16(record->event.time, prev_time);
|
||||
if (flow_tap_expired || idle_time >= 500) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const uint16_t keycode = get_record_keycode(record, false);
|
||||
if (is_mt_or_lt(keycode)) {
|
||||
uint16_t term = get_flow_tap_term(keycode, record, flow_tap_prev_keycode);
|
||||
if (term > 500) {
|
||||
term = 500;
|
||||
}
|
||||
if (idle_time < term) {
|
||||
debug_event(record->event);
|
||||
ac_dprintf(" within flow tap term (%u < %u) considered a tap\n", idle_time, term);
|
||||
record->tap.count = 1;
|
||||
registered_taps_add(record->event.key);
|
||||
debug_registered_taps();
|
||||
process_record(record);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// By default, enable Flow Tap for the keys in the main alphas area and Space.
|
||||
// This should work reasonably even if the layout is remapped on the host to an
|
||||
// alt layout or international layout (e.g. Dvorak or AZERTY), where these same
|
||||
// key positions are mostly used for typing letters.
|
||||
__attribute__((weak)) bool is_flow_tap_key(uint16_t keycode) {
|
||||
if ((get_mods() & (MOD_MASK_CG | MOD_BIT_LALT)) != 0) {
|
||||
return false; // Disable Flow Tap on hotkeys.
|
||||
}
|
||||
switch (get_tap_keycode(keycode)) {
|
||||
case KC_SPC:
|
||||
case KC_A ... KC_Z:
|
||||
case KC_DOT:
|
||||
case KC_COMM:
|
||||
case KC_SCLN:
|
||||
case KC_SLSH:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
__attribute__((weak)) uint16_t get_flow_tap_term(uint16_t keycode, keyrecord_t *record, uint16_t prev_keycode) {
|
||||
if (is_flow_tap_key(keycode) && is_flow_tap_key(prev_keycode)) {
|
||||
return FLOW_TAP_TERM;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
# endif // FLOW_TAP_TERM
|
||||
|
||||
/** \brief Logs tapping key if ACTION_DEBUG is enabled. */
|
||||
static void debug_tapping_key(void) {
|
||||
ac_dprintf("TAPPING_KEY=");
|
||||
|
||||
@@ -111,6 +111,66 @@ char chordal_hold_handedness(keypos_t key);
|
||||
extern const char chordal_hold_layout[MATRIX_ROWS][MATRIX_COLS] PROGMEM;
|
||||
#endif
|
||||
|
||||
#ifdef FLOW_TAP_TERM
|
||||
/**
|
||||
* Callback to specify the keys where Flow Tap is enabled.
|
||||
*
|
||||
* Flow Tap is constrained to certain keys by the following rule: this callback
|
||||
* is called for both the tap-hold key *and* the key press immediately preceding
|
||||
* it. If the callback returns true for both keycodes, Flow Tap is enabled.
|
||||
*
|
||||
* The default implementation of this callback corresponds to
|
||||
*
|
||||
* bool is_flow_tap_key(uint16_t keycode) {
|
||||
* switch (get_tap_keycode(keycode)) {
|
||||
* case KC_SPC:
|
||||
* case KC_A ... KC_Z:
|
||||
* case KC_DOT:
|
||||
* case KC_COMM:
|
||||
* case KC_SCLN:
|
||||
* case KC_SLSH:
|
||||
* return true;
|
||||
* }
|
||||
* return false;
|
||||
* }
|
||||
*
|
||||
* @param keycode Keycode of the key.
|
||||
* @return Whether to enable Flow Tap for this key.
|
||||
*/
|
||||
bool is_flow_tap_key(uint16_t keycode);
|
||||
|
||||
/**
|
||||
* Callback to customize Flow Tap filtering.
|
||||
*
|
||||
* Flow Tap acts only when key events are closer together than this time.
|
||||
*
|
||||
* Return a time of 0 to disable filtering. In this way, Flow Tap may be
|
||||
* disabled for certain tap-hold keys, or when following certain previous keys.
|
||||
*
|
||||
* The default implementation of this callback is
|
||||
*
|
||||
* uint16_t get_flow_tap_term(uint16_t keycode, keyrecord_t* record,
|
||||
* uint16_t prev_keycode) {
|
||||
* if (is_flow_tap_key(keycode) && is_flow_tap_key(prev_keycode)) {
|
||||
* return g_flow_tap_term;
|
||||
* }
|
||||
* return 0;
|
||||
* }
|
||||
*
|
||||
* NOTE: If both `is_flow_tap_key()` and `get_flow_tap_term()` are defined, then
|
||||
* `get_flow_tap_term()` takes precedence.
|
||||
*
|
||||
* @param keycode Keycode of the tap-hold key.
|
||||
* @param record keyrecord_t of the tap-hold event.
|
||||
* @param prev_keycode Keycode of the previously pressed key.
|
||||
* @return Time in milliseconds.
|
||||
*/
|
||||
uint16_t get_flow_tap_term(uint16_t keycode, keyrecord_t *record, uint16_t prev_keycode);
|
||||
|
||||
/** Updates the Flow Tap last key and timer. */
|
||||
void flow_tap_update_last_event(keyrecord_t *record);
|
||||
#endif // FLOW_TAP_TERM
|
||||
|
||||
#ifdef DYNAMIC_TAPPING_TERM_ENABLE
|
||||
extern uint16_t g_tapping_term;
|
||||
#endif
|
||||
|
||||
@@ -21,7 +21,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "action_layer.h"
|
||||
#include "timer.h"
|
||||
#include "keycode_config.h"
|
||||
#include "usb_device_state.h"
|
||||
#include <string.h>
|
||||
|
||||
extern keymap_config_t keymap_config;
|
||||
@@ -220,7 +219,7 @@ bool is_oneshot_layer_active(void) {
|
||||
void oneshot_set(bool active) {
|
||||
if (keymap_config.oneshot_enable != active) {
|
||||
keymap_config.oneshot_enable = active;
|
||||
eeconfig_update_keymap(keymap_config.raw);
|
||||
eeconfig_update_keymap(&keymap_config);
|
||||
clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
|
||||
dprintf("Oneshot: active: %d\n", active);
|
||||
}
|
||||
@@ -319,14 +318,12 @@ void send_nkro_report(void) {
|
||||
*/
|
||||
void send_keyboard_report(void) {
|
||||
#ifdef NKRO_ENABLE
|
||||
if (usb_device_state_get_protocol() == USB_PROTOCOL_REPORT && keymap_config.nkro) {
|
||||
if (host_can_send_nkro() && keymap_config.nkro) {
|
||||
send_nkro_report();
|
||||
} else {
|
||||
send_6kro_report();
|
||||
return;
|
||||
}
|
||||
#else
|
||||
send_6kro_report();
|
||||
#endif
|
||||
send_6kro_report();
|
||||
}
|
||||
|
||||
/** \brief Get mods
|
||||
|
||||
@@ -149,14 +149,14 @@ void audio_driver_start(void) {
|
||||
}
|
||||
|
||||
void eeconfig_update_audio_current(void) {
|
||||
eeconfig_update_audio(audio_config.raw);
|
||||
eeconfig_update_audio(&audio_config);
|
||||
}
|
||||
|
||||
void eeconfig_update_audio_default(void) {
|
||||
audio_config.valid = true;
|
||||
audio_config.enable = AUDIO_DEFAULT_ON;
|
||||
audio_config.clicky_enable = AUDIO_DEFAULT_CLICKY_ON;
|
||||
eeconfig_update_audio(audio_config.raw);
|
||||
eeconfig_update_audio(&audio_config);
|
||||
}
|
||||
|
||||
void audio_init(void) {
|
||||
@@ -164,7 +164,7 @@ void audio_init(void) {
|
||||
return;
|
||||
}
|
||||
|
||||
audio_config.raw = eeconfig_read_audio();
|
||||
eeconfig_read_audio(&audio_config);
|
||||
if (!audio_config.valid) {
|
||||
dprintf("audio_init audio_config.valid = 0. Write default values to EEPROM.\n");
|
||||
eeconfig_update_audio_default();
|
||||
@@ -196,7 +196,7 @@ void audio_toggle(void) {
|
||||
stop_all_notes();
|
||||
}
|
||||
audio_config.enable ^= 1;
|
||||
eeconfig_update_audio(audio_config.raw);
|
||||
eeconfig_update_audio(&audio_config);
|
||||
if (audio_config.enable) {
|
||||
audio_on_user();
|
||||
} else {
|
||||
@@ -206,7 +206,7 @@ void audio_toggle(void) {
|
||||
|
||||
void audio_on(void) {
|
||||
audio_config.enable = 1;
|
||||
eeconfig_update_audio(audio_config.raw);
|
||||
eeconfig_update_audio(&audio_config);
|
||||
audio_on_user();
|
||||
PLAY_SONG(audio_on_song);
|
||||
}
|
||||
@@ -217,7 +217,7 @@ void audio_off(void) {
|
||||
wait_ms(100);
|
||||
audio_stop_all();
|
||||
audio_config.enable = 0;
|
||||
eeconfig_update_audio(audio_config.raw);
|
||||
eeconfig_update_audio(&audio_config);
|
||||
}
|
||||
|
||||
bool audio_is_on(void) {
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "compiler_support.h"
|
||||
#include "musical_notes.h"
|
||||
#include "song_list.h"
|
||||
#include "voices.h"
|
||||
@@ -28,7 +30,7 @@
|
||||
# include "audio_dac.h"
|
||||
#endif
|
||||
|
||||
typedef union {
|
||||
typedef union audio_config_t {
|
||||
uint8_t raw;
|
||||
struct {
|
||||
bool enable : 1;
|
||||
@@ -38,7 +40,7 @@ typedef union {
|
||||
};
|
||||
} audio_config_t;
|
||||
|
||||
_Static_assert(sizeof(audio_config_t) == sizeof(uint8_t), "Audio EECONFIG out of spec.");
|
||||
STATIC_ASSERT(sizeof(audio_config_t) == sizeof(uint8_t), "Audio EECONFIG out of spec.");
|
||||
|
||||
/*
|
||||
* a 'musical note' is represented by pitch and duration; a 'musical tone' adds intensity and timbre
|
||||
|
||||
@@ -16,7 +16,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "backlight.h"
|
||||
#include "eeprom.h"
|
||||
#include "eeconfig.h"
|
||||
#include "debug.h"
|
||||
|
||||
@@ -55,7 +54,7 @@ static void backlight_check_config(void) {
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
void backlight_init(void) {
|
||||
backlight_config.raw = eeconfig_read_backlight();
|
||||
eeconfig_read_backlight(&backlight_config);
|
||||
if (!backlight_config.valid) {
|
||||
dprintf("backlight_init backlight_config.valid = 0. Write default values to EEPROM.\n");
|
||||
eeconfig_update_backlight_default();
|
||||
@@ -74,7 +73,7 @@ void backlight_increase(void) {
|
||||
backlight_config.level++;
|
||||
}
|
||||
backlight_config.enable = 1;
|
||||
eeconfig_update_backlight(backlight_config.raw);
|
||||
eeconfig_update_backlight(&backlight_config);
|
||||
dprintf("backlight increase: %u\n", backlight_config.level);
|
||||
backlight_set(backlight_config.level);
|
||||
}
|
||||
@@ -87,7 +86,7 @@ void backlight_decrease(void) {
|
||||
if (backlight_config.level > 0) {
|
||||
backlight_config.level--;
|
||||
backlight_config.enable = !!backlight_config.level;
|
||||
eeconfig_update_backlight(backlight_config.raw);
|
||||
eeconfig_update_backlight(&backlight_config);
|
||||
}
|
||||
dprintf("backlight decrease: %u\n", backlight_config.level);
|
||||
backlight_set(backlight_config.level);
|
||||
@@ -116,7 +115,7 @@ void backlight_enable(void) {
|
||||
backlight_config.enable = true;
|
||||
if (backlight_config.raw == 1) // enabled but level == 0
|
||||
backlight_config.level = 1;
|
||||
eeconfig_update_backlight(backlight_config.raw);
|
||||
eeconfig_update_backlight(&backlight_config);
|
||||
dprintf("backlight enable\n");
|
||||
backlight_set(backlight_config.level);
|
||||
}
|
||||
@@ -129,7 +128,7 @@ void backlight_disable(void) {
|
||||
if (!backlight_config.enable) return; // do nothing if backlight is already off
|
||||
|
||||
backlight_config.enable = false;
|
||||
eeconfig_update_backlight(backlight_config.raw);
|
||||
eeconfig_update_backlight(&backlight_config);
|
||||
dprintf("backlight disable\n");
|
||||
backlight_set(0);
|
||||
}
|
||||
@@ -152,7 +151,7 @@ void backlight_step(void) {
|
||||
backlight_config.level = 0;
|
||||
}
|
||||
backlight_config.enable = !!backlight_config.level;
|
||||
eeconfig_update_backlight(backlight_config.raw);
|
||||
eeconfig_update_backlight(&backlight_config);
|
||||
dprintf("backlight step: %u\n", backlight_config.level);
|
||||
backlight_set(backlight_config.level);
|
||||
}
|
||||
@@ -173,19 +172,11 @@ void backlight_level_noeeprom(uint8_t level) {
|
||||
*/
|
||||
void backlight_level(uint8_t level) {
|
||||
backlight_level_noeeprom(level);
|
||||
eeconfig_update_backlight(backlight_config.raw);
|
||||
}
|
||||
|
||||
uint8_t eeconfig_read_backlight(void) {
|
||||
return eeprom_read_byte(EECONFIG_BACKLIGHT);
|
||||
}
|
||||
|
||||
void eeconfig_update_backlight(uint8_t val) {
|
||||
eeprom_update_byte(EECONFIG_BACKLIGHT, val);
|
||||
eeconfig_update_backlight(&backlight_config);
|
||||
}
|
||||
|
||||
void eeconfig_update_backlight_current(void) {
|
||||
eeconfig_update_backlight(backlight_config.raw);
|
||||
eeconfig_update_backlight(&backlight_config);
|
||||
}
|
||||
|
||||
void eeconfig_update_backlight_default(void) {
|
||||
@@ -193,7 +184,7 @@ void eeconfig_update_backlight_default(void) {
|
||||
backlight_config.enable = BACKLIGHT_DEFAULT_ON;
|
||||
backlight_config.breathing = BACKLIGHT_DEFAULT_BREATHING;
|
||||
backlight_config.level = BACKLIGHT_DEFAULT_LEVEL;
|
||||
eeconfig_update_backlight(backlight_config.raw);
|
||||
eeconfig_update_backlight(&backlight_config);
|
||||
}
|
||||
|
||||
/** \brief Get backlight level
|
||||
@@ -226,7 +217,7 @@ void backlight_enable_breathing(void) {
|
||||
if (backlight_config.breathing) return; // do nothing if breathing is already on
|
||||
|
||||
backlight_config.breathing = true;
|
||||
eeconfig_update_backlight(backlight_config.raw);
|
||||
eeconfig_update_backlight(&backlight_config);
|
||||
dprintf("backlight breathing enable\n");
|
||||
breathing_enable();
|
||||
}
|
||||
@@ -239,7 +230,7 @@ void backlight_disable_breathing(void) {
|
||||
if (!backlight_config.breathing) return; // do nothing if breathing is already off
|
||||
|
||||
backlight_config.breathing = false;
|
||||
eeconfig_update_backlight(backlight_config.raw);
|
||||
eeconfig_update_backlight(&backlight_config);
|
||||
dprintf("backlight breathing disable\n");
|
||||
breathing_disable();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "compiler_support.h"
|
||||
|
||||
#ifndef BACKLIGHT_LEVELS
|
||||
# define BACKLIGHT_LEVELS 3
|
||||
#elif BACKLIGHT_LEVELS > 31
|
||||
@@ -34,7 +36,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# define BREATHING_PERIOD 6
|
||||
#endif
|
||||
|
||||
typedef union {
|
||||
typedef union backlight_config_t {
|
||||
uint8_t raw;
|
||||
struct {
|
||||
bool enable : 1;
|
||||
@@ -44,7 +46,7 @@ typedef union {
|
||||
};
|
||||
} backlight_config_t;
|
||||
|
||||
_Static_assert(sizeof(backlight_config_t) == sizeof(uint8_t), "Backlight EECONFIG out of spec.");
|
||||
STATIC_ASSERT(sizeof(backlight_config_t) == sizeof(uint8_t), "Backlight EECONFIG out of spec.");
|
||||
|
||||
void backlight_init(void);
|
||||
void backlight_toggle(void);
|
||||
@@ -58,10 +60,8 @@ void backlight_level_noeeprom(uint8_t level);
|
||||
void backlight_level(uint8_t level);
|
||||
uint8_t get_backlight_level(void);
|
||||
|
||||
uint8_t eeconfig_read_backlight(void);
|
||||
void eeconfig_update_backlight(uint8_t val);
|
||||
void eeconfig_update_backlight_current(void);
|
||||
void eeconfig_update_backlight_default(void);
|
||||
void eeconfig_update_backlight_current(void);
|
||||
void eeconfig_update_backlight_default(void);
|
||||
|
||||
// implementation specific
|
||||
void backlight_init_ports(void);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* Remove these once we transitioned to C23 across all platfroms */
|
||||
/* Remove these once we transitioned to C23 across all platforms */
|
||||
#define UINT32_WIDTH 32
|
||||
#define UINT64_WIDTH 64
|
||||
|
||||
|
||||
@@ -243,10 +243,10 @@ static void print_status(void) {
|
||||
|
||||
#if !defined(NO_PRINT) && !defined(USER_PRINT)
|
||||
static void print_eeconfig(void) {
|
||||
xprintf("eeconfig:\ndefault_layer: %u\n", eeconfig_read_default_layer());
|
||||
xprintf("eeconfig:\ndefault_layer: %" PRIu32 "\n", (uint32_t)eeconfig_read_default_layer());
|
||||
|
||||
debug_config_t dc;
|
||||
dc.raw = eeconfig_read_debug();
|
||||
eeconfig_read_debug(&dc);
|
||||
xprintf(/* clang-format off */
|
||||
|
||||
"debug_config.raw: %02X\n"
|
||||
@@ -263,7 +263,7 @@ static void print_eeconfig(void) {
|
||||
); /* clang-format on */
|
||||
|
||||
keymap_config_t kc;
|
||||
kc.raw = eeconfig_read_keymap();
|
||||
eeconfig_read_keymap(&kc);
|
||||
xprintf(/* clang-format off */
|
||||
|
||||
"keymap_config.raw: %02X\n"
|
||||
@@ -296,7 +296,7 @@ static void print_eeconfig(void) {
|
||||
# ifdef BACKLIGHT_ENABLE
|
||||
|
||||
backlight_config_t bc;
|
||||
bc.raw = eeconfig_read_backlight();
|
||||
eeconfig_read_backlight(&bc);
|
||||
xprintf(/* clang-format off */
|
||||
"backlight_config"
|
||||
|
||||
|
||||
15
quantum/compiler_support.h
Normal file
15
quantum/compiler_support.h
Normal file
@@ -0,0 +1,15 @@
|
||||
// Copyright 2025 QMK Contributors
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
/**
|
||||
* @brief Perfom an assertion at compile time.
|
||||
*
|
||||
* `_Static_assert` is C<23, while `static_assert` is C++/C23.
|
||||
*/
|
||||
#if !defined(STATIC_ASSERT)
|
||||
# ifdef __cplusplus
|
||||
# define STATIC_ASSERT static_assert
|
||||
# else
|
||||
# define STATIC_ASSERT _Static_assert
|
||||
# endif
|
||||
#endif
|
||||
141
quantum/connection/connection.c
Normal file
141
quantum/connection/connection.c
Normal file
@@ -0,0 +1,141 @@
|
||||
// Copyright 2025 QMK
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#include "connection.h"
|
||||
#include "eeconfig.h"
|
||||
#include "usb_util.h"
|
||||
#include "util.h"
|
||||
|
||||
#ifdef BLUETOOTH_ENABLE
|
||||
# include "bluetooth.h"
|
||||
#endif
|
||||
|
||||
// ======== DEPRECATED DEFINES - DO NOT USE ========
|
||||
#ifdef OUTPUT_DEFAULT
|
||||
# undef CONNECTION_HOST_DEFAULT
|
||||
# define CONNECTION_HOST_DEFAULT OUTPUT_DEFAULT
|
||||
#endif
|
||||
|
||||
__attribute__((weak)) void set_output_user(uint8_t output) {}
|
||||
// ========
|
||||
|
||||
#define CONNECTION_HOST_INVALID 0xFF
|
||||
|
||||
#ifndef CONNECTION_HOST_DEFAULT
|
||||
# define CONNECTION_HOST_DEFAULT CONNECTION_HOST_AUTO
|
||||
#endif
|
||||
|
||||
static const connection_host_t host_candidates[] = {
|
||||
CONNECTION_HOST_AUTO,
|
||||
CONNECTION_HOST_USB,
|
||||
#ifdef BLUETOOTH_ENABLE
|
||||
CONNECTION_HOST_BLUETOOTH,
|
||||
#endif
|
||||
#if 0
|
||||
CONNECTION_HOST_2P4GHZ,
|
||||
#endif
|
||||
};
|
||||
|
||||
#define HOST_CANDIDATES_COUNT ARRAY_SIZE(host_candidates)
|
||||
|
||||
static connection_config_t config = {.desired_host = CONNECTION_HOST_INVALID};
|
||||
|
||||
void eeconfig_update_connection_default(void) {
|
||||
config.desired_host = CONNECTION_HOST_DEFAULT;
|
||||
|
||||
eeconfig_update_connection(&config);
|
||||
}
|
||||
|
||||
void connection_init(void) {
|
||||
eeconfig_read_connection(&config);
|
||||
if (config.desired_host == CONNECTION_HOST_INVALID) {
|
||||
eeconfig_update_connection_default();
|
||||
}
|
||||
}
|
||||
|
||||
__attribute__((weak)) void connection_host_changed_user(connection_host_t host) {}
|
||||
__attribute__((weak)) void connection_host_changed_kb(connection_host_t host) {}
|
||||
|
||||
static void handle_host_changed(void) {
|
||||
connection_host_changed_user(config.desired_host);
|
||||
connection_host_changed_kb(config.desired_host);
|
||||
|
||||
// TODO: Remove deprecated callback
|
||||
set_output_user(config.desired_host);
|
||||
}
|
||||
|
||||
void connection_set_host_noeeprom(connection_host_t host) {
|
||||
if (config.desired_host == host) {
|
||||
return;
|
||||
}
|
||||
|
||||
config.desired_host = host;
|
||||
|
||||
handle_host_changed();
|
||||
}
|
||||
|
||||
void connection_set_host(connection_host_t host) {
|
||||
connection_set_host_noeeprom(host);
|
||||
|
||||
eeconfig_update_connection(&config);
|
||||
}
|
||||
|
||||
void connection_next_host_noeeprom(void) {
|
||||
uint8_t next = 0;
|
||||
for (uint8_t i = 0; i < HOST_CANDIDATES_COUNT; i++) {
|
||||
if (host_candidates[i] == config.desired_host) {
|
||||
next = i == HOST_CANDIDATES_COUNT - 1 ? 0 : i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
connection_set_host_noeeprom(host_candidates[next]);
|
||||
}
|
||||
|
||||
void connection_next_host(void) {
|
||||
connection_next_host_noeeprom();
|
||||
|
||||
eeconfig_update_connection(&config);
|
||||
}
|
||||
|
||||
void connection_prev_host_noeeprom(void) {
|
||||
uint8_t next = 0;
|
||||
for (uint8_t i = 0; i < HOST_CANDIDATES_COUNT; i++) {
|
||||
if (host_candidates[i] == config.desired_host) {
|
||||
next = i == 0 ? HOST_CANDIDATES_COUNT - 1 : i - 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
connection_set_host_noeeprom(host_candidates[next]);
|
||||
}
|
||||
|
||||
void connection_prev_host(void) {
|
||||
connection_prev_host_noeeprom();
|
||||
|
||||
eeconfig_update_connection(&config);
|
||||
}
|
||||
|
||||
connection_host_t connection_get_host_raw(void) {
|
||||
return config.desired_host;
|
||||
}
|
||||
|
||||
connection_host_t connection_auto_detect_host(void) {
|
||||
if (usb_connected_state()) {
|
||||
return CONNECTION_HOST_USB;
|
||||
}
|
||||
|
||||
#ifdef BLUETOOTH_ENABLE
|
||||
if (bluetooth_is_connected()) {
|
||||
return CONNECTION_HOST_BLUETOOTH;
|
||||
}
|
||||
#endif
|
||||
|
||||
return CONNECTION_HOST_NONE;
|
||||
}
|
||||
|
||||
connection_host_t connection_get_host(void) {
|
||||
if (config.desired_host == CONNECTION_HOST_AUTO) {
|
||||
return connection_auto_detect_host();
|
||||
}
|
||||
return config.desired_host;
|
||||
}
|
||||
112
quantum/connection/connection.h
Normal file
112
quantum/connection/connection.h
Normal file
@@ -0,0 +1,112 @@
|
||||
// Copyright 2025 QMK
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "compiler_support.h"
|
||||
#include "util.h"
|
||||
|
||||
/**
|
||||
* \enum connection_host_t
|
||||
*
|
||||
* An enumeration of the possible hosts.
|
||||
*/
|
||||
typedef enum connection_host_t {
|
||||
CONNECTION_HOST_AUTO,
|
||||
|
||||
CONNECTION_HOST_NONE,
|
||||
CONNECTION_HOST_USB,
|
||||
CONNECTION_HOST_BLUETOOTH,
|
||||
CONNECTION_HOST_2P4GHZ
|
||||
} connection_host_t;
|
||||
|
||||
/**
|
||||
* \union connection_config_t
|
||||
*
|
||||
* Configuration structure for the connection subsystem.
|
||||
*/
|
||||
typedef union connection_config_t {
|
||||
uint8_t raw;
|
||||
connection_host_t desired_host : 8;
|
||||
} PACKED connection_config_t;
|
||||
|
||||
STATIC_ASSERT(sizeof(connection_config_t) == sizeof(uint8_t), "Connection EECONFIG out of spec.");
|
||||
|
||||
/**
|
||||
* \brief Initialize the subsystem.
|
||||
*
|
||||
* This function must be called only once, before any of the below functions can be called.
|
||||
*/
|
||||
void connection_init(void);
|
||||
|
||||
/**
|
||||
* \brief Get currently configured host. Does not resolve 'CONNECTION_HOST_AUTO'.
|
||||
*
|
||||
* \return 'connection_host_t' of the configured host.
|
||||
*/
|
||||
connection_host_t connection_get_host_raw(void);
|
||||
|
||||
/**
|
||||
* \brief Get current active host.
|
||||
*
|
||||
* \return 'connection_host_t' of the configured host.
|
||||
*/
|
||||
connection_host_t connection_auto_detect_host(void);
|
||||
|
||||
/**
|
||||
* \brief Get currently configured host. Resolves 'CONNECTION_HOST_AUTO' using 'connection_auto_detect_host()'.
|
||||
*
|
||||
* \return 'connection_host_t' of the configured host.
|
||||
*/
|
||||
connection_host_t connection_get_host(void);
|
||||
|
||||
/**
|
||||
* \brief Get current host. New state is not written to EEPROM.
|
||||
*
|
||||
* \param host The host to configure.
|
||||
*/
|
||||
void connection_set_host_noeeprom(connection_host_t host);
|
||||
|
||||
/**
|
||||
* \brief Get current host.
|
||||
*
|
||||
* \param host The host to configure.
|
||||
*/
|
||||
void connection_set_host(connection_host_t host);
|
||||
|
||||
/**
|
||||
* \brief Move to the next potential host. New state is not written to EEPROM.
|
||||
*
|
||||
*/
|
||||
void connection_next_host_noeeprom(void);
|
||||
|
||||
/**
|
||||
* \brief Move to the next potential host.
|
||||
*
|
||||
*/
|
||||
void connection_next_host(void);
|
||||
|
||||
/**
|
||||
* \brief Move to the previous potential host. New state is not written to EEPROM.
|
||||
*
|
||||
*/
|
||||
void connection_prev_host_noeeprom(void);
|
||||
|
||||
/**
|
||||
* \brief Move to the previous potential host.
|
||||
*
|
||||
*/
|
||||
void connection_prev_host(void);
|
||||
|
||||
/**
|
||||
* \brief user hook called when changing configured host
|
||||
*
|
||||
*/
|
||||
void connection_host_changed_user(connection_host_t host);
|
||||
|
||||
/**
|
||||
* \brief keyboard hook called when changing configured host
|
||||
*
|
||||
*/
|
||||
void connection_host_changed_kb(connection_host_t host);
|
||||
@@ -1,4 +1,5 @@
|
||||
/* Copyright 2017 Jason Williams (Wilba)
|
||||
* Copyright 2024-2025 Nick Brassel (@tzarc)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -17,18 +18,9 @@
|
||||
#include "dynamic_keymap.h"
|
||||
#include "keymap_introspection.h"
|
||||
#include "action.h"
|
||||
#include "eeprom.h"
|
||||
#include "progmem.h"
|
||||
#include "send_string.h"
|
||||
#include "keycodes.h"
|
||||
|
||||
#ifdef VIA_ENABLE
|
||||
# include "via.h"
|
||||
# define DYNAMIC_KEYMAP_EEPROM_START (VIA_EEPROM_CONFIG_END)
|
||||
#else
|
||||
# include "eeconfig.h"
|
||||
# define DYNAMIC_KEYMAP_EEPROM_START (EECONFIG_SIZE)
|
||||
#endif
|
||||
#include "nvm_dynamic_keymap.h"
|
||||
|
||||
#ifdef ENCODER_ENABLE
|
||||
# include "encoder.h"
|
||||
@@ -36,67 +28,6 @@
|
||||
# define NUM_ENCODERS 0
|
||||
#endif
|
||||
|
||||
#ifndef DYNAMIC_KEYMAP_LAYER_COUNT
|
||||
# define DYNAMIC_KEYMAP_LAYER_COUNT 4
|
||||
#endif
|
||||
|
||||
#ifndef DYNAMIC_KEYMAP_MACRO_COUNT
|
||||
# define DYNAMIC_KEYMAP_MACRO_COUNT 16
|
||||
#endif
|
||||
|
||||
#ifndef TOTAL_EEPROM_BYTE_COUNT
|
||||
# error Unknown total EEPROM size. Cannot derive maximum for dynamic keymaps.
|
||||
#endif
|
||||
|
||||
#ifndef DYNAMIC_KEYMAP_EEPROM_MAX_ADDR
|
||||
# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR (TOTAL_EEPROM_BYTE_COUNT - 1)
|
||||
#endif
|
||||
|
||||
#if DYNAMIC_KEYMAP_EEPROM_MAX_ADDR > (TOTAL_EEPROM_BYTE_COUNT - 1)
|
||||
# pragma message STR(DYNAMIC_KEYMAP_EEPROM_MAX_ADDR) " > " STR((TOTAL_EEPROM_BYTE_COUNT - 1))
|
||||
# error DYNAMIC_KEYMAP_EEPROM_MAX_ADDR is configured to use more space than what is available for the selected EEPROM driver
|
||||
#endif
|
||||
|
||||
// Due to usage of uint16_t check for max 65535
|
||||
#if DYNAMIC_KEYMAP_EEPROM_MAX_ADDR > 65535
|
||||
# pragma message STR(DYNAMIC_KEYMAP_EEPROM_MAX_ADDR) " > 65535"
|
||||
# error DYNAMIC_KEYMAP_EEPROM_MAX_ADDR must be less than 65536
|
||||
#endif
|
||||
|
||||
// If DYNAMIC_KEYMAP_EEPROM_ADDR not explicitly defined in config.h,
|
||||
#ifndef DYNAMIC_KEYMAP_EEPROM_ADDR
|
||||
# define DYNAMIC_KEYMAP_EEPROM_ADDR DYNAMIC_KEYMAP_EEPROM_START
|
||||
#endif
|
||||
|
||||
// Dynamic encoders starts after dynamic keymaps
|
||||
#ifndef DYNAMIC_KEYMAP_ENCODER_EEPROM_ADDR
|
||||
# define DYNAMIC_KEYMAP_ENCODER_EEPROM_ADDR (DYNAMIC_KEYMAP_EEPROM_ADDR + (DYNAMIC_KEYMAP_LAYER_COUNT * MATRIX_ROWS * MATRIX_COLS * 2))
|
||||
#endif
|
||||
|
||||
// Dynamic macro starts after dynamic encoders, but only when using ENCODER_MAP
|
||||
#ifdef ENCODER_MAP_ENABLE
|
||||
# ifndef DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR
|
||||
# define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR (DYNAMIC_KEYMAP_ENCODER_EEPROM_ADDR + (DYNAMIC_KEYMAP_LAYER_COUNT * NUM_ENCODERS * 2 * 2))
|
||||
# endif // DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR
|
||||
#else // ENCODER_MAP_ENABLE
|
||||
# ifndef DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR
|
||||
# define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR (DYNAMIC_KEYMAP_ENCODER_EEPROM_ADDR)
|
||||
# endif // DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR
|
||||
#endif // ENCODER_MAP_ENABLE
|
||||
|
||||
// Sanity check that dynamic keymaps fit in available EEPROM
|
||||
// If there's not 100 bytes available for macros, then something is wrong.
|
||||
// The keyboard should override DYNAMIC_KEYMAP_LAYER_COUNT to reduce it,
|
||||
// or DYNAMIC_KEYMAP_EEPROM_MAX_ADDR to increase it, *only if* the microcontroller has
|
||||
// more than the default.
|
||||
_Static_assert((DYNAMIC_KEYMAP_EEPROM_MAX_ADDR) - (DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR) >= 100, "Dynamic keymaps are configured to use more EEPROM than is available.");
|
||||
|
||||
// Dynamic macros are stored after the keymaps and use what is available
|
||||
// up to and including DYNAMIC_KEYMAP_EEPROM_MAX_ADDR.
|
||||
#ifndef DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE
|
||||
# define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE (DYNAMIC_KEYMAP_EEPROM_MAX_ADDR - DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + 1)
|
||||
#endif
|
||||
|
||||
#ifndef DYNAMIC_KEYMAP_MACRO_DELAY
|
||||
# define DYNAMIC_KEYMAP_MACRO_DELAY TAP_CODE_DELAY
|
||||
#endif
|
||||
@@ -105,52 +36,28 @@ uint8_t dynamic_keymap_get_layer_count(void) {
|
||||
return DYNAMIC_KEYMAP_LAYER_COUNT;
|
||||
}
|
||||
|
||||
void *dynamic_keymap_key_to_eeprom_address(uint8_t layer, uint8_t row, uint8_t column) {
|
||||
// TODO: optimize this with some left shifts
|
||||
return ((void *)DYNAMIC_KEYMAP_EEPROM_ADDR) + (layer * MATRIX_ROWS * MATRIX_COLS * 2) + (row * MATRIX_COLS * 2) + (column * 2);
|
||||
}
|
||||
|
||||
uint16_t dynamic_keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t column) {
|
||||
if (layer >= DYNAMIC_KEYMAP_LAYER_COUNT || row >= MATRIX_ROWS || column >= MATRIX_COLS) return KC_NO;
|
||||
void *address = dynamic_keymap_key_to_eeprom_address(layer, row, column);
|
||||
// Big endian, so we can read/write EEPROM directly from host if we want
|
||||
uint16_t keycode = eeprom_read_byte(address) << 8;
|
||||
keycode |= eeprom_read_byte(address + 1);
|
||||
return keycode;
|
||||
return nvm_dynamic_keymap_read_keycode(layer, row, column);
|
||||
}
|
||||
|
||||
void dynamic_keymap_set_keycode(uint8_t layer, uint8_t row, uint8_t column, uint16_t keycode) {
|
||||
if (layer >= DYNAMIC_KEYMAP_LAYER_COUNT || row >= MATRIX_ROWS || column >= MATRIX_COLS) return;
|
||||
void *address = dynamic_keymap_key_to_eeprom_address(layer, row, column);
|
||||
// Big endian, so we can read/write EEPROM directly from host if we want
|
||||
eeprom_update_byte(address, (uint8_t)(keycode >> 8));
|
||||
eeprom_update_byte(address + 1, (uint8_t)(keycode & 0xFF));
|
||||
nvm_dynamic_keymap_update_keycode(layer, row, column, keycode);
|
||||
}
|
||||
|
||||
#ifdef ENCODER_MAP_ENABLE
|
||||
void *dynamic_keymap_encoder_to_eeprom_address(uint8_t layer, uint8_t encoder_id) {
|
||||
return ((void *)DYNAMIC_KEYMAP_ENCODER_EEPROM_ADDR) + (layer * NUM_ENCODERS * 2 * 2) + (encoder_id * 2 * 2);
|
||||
}
|
||||
|
||||
uint16_t dynamic_keymap_get_encoder(uint8_t layer, uint8_t encoder_id, bool clockwise) {
|
||||
if (layer >= DYNAMIC_KEYMAP_LAYER_COUNT || encoder_id >= NUM_ENCODERS) return KC_NO;
|
||||
void *address = dynamic_keymap_encoder_to_eeprom_address(layer, encoder_id);
|
||||
// Big endian, so we can read/write EEPROM directly from host if we want
|
||||
uint16_t keycode = ((uint16_t)eeprom_read_byte(address + (clockwise ? 0 : 2))) << 8;
|
||||
keycode |= eeprom_read_byte(address + (clockwise ? 0 : 2) + 1);
|
||||
return keycode;
|
||||
return nvm_dynamic_keymap_read_encoder(layer, encoder_id, clockwise);
|
||||
}
|
||||
|
||||
void dynamic_keymap_set_encoder(uint8_t layer, uint8_t encoder_id, bool clockwise, uint16_t keycode) {
|
||||
if (layer >= DYNAMIC_KEYMAP_LAYER_COUNT || encoder_id >= NUM_ENCODERS) return;
|
||||
void *address = dynamic_keymap_encoder_to_eeprom_address(layer, encoder_id);
|
||||
// Big endian, so we can read/write EEPROM directly from host if we want
|
||||
eeprom_update_byte(address + (clockwise ? 0 : 2), (uint8_t)(keycode >> 8));
|
||||
eeprom_update_byte(address + (clockwise ? 0 : 2) + 1, (uint8_t)(keycode & 0xFF));
|
||||
nvm_dynamic_keymap_update_encoder(layer, encoder_id, clockwise, keycode);
|
||||
}
|
||||
#endif // ENCODER_MAP_ENABLE
|
||||
|
||||
void dynamic_keymap_reset(void) {
|
||||
// Erase the keymaps, if necessary.
|
||||
nvm_dynamic_keymap_erase();
|
||||
|
||||
// Reset the keymaps in EEPROM to what is in flash.
|
||||
for (int layer = 0; layer < DYNAMIC_KEYMAP_LAYER_COUNT; layer++) {
|
||||
for (int row = 0; row < MATRIX_ROWS; row++) {
|
||||
@@ -168,31 +75,11 @@ void dynamic_keymap_reset(void) {
|
||||
}
|
||||
|
||||
void dynamic_keymap_get_buffer(uint16_t offset, uint16_t size, uint8_t *data) {
|
||||
uint16_t dynamic_keymap_eeprom_size = DYNAMIC_KEYMAP_LAYER_COUNT * MATRIX_ROWS * MATRIX_COLS * 2;
|
||||
void * source = (void *)(DYNAMIC_KEYMAP_EEPROM_ADDR + offset);
|
||||
uint8_t *target = data;
|
||||
for (uint16_t i = 0; i < size; i++) {
|
||||
if (offset + i < dynamic_keymap_eeprom_size) {
|
||||
*target = eeprom_read_byte(source);
|
||||
} else {
|
||||
*target = 0x00;
|
||||
}
|
||||
source++;
|
||||
target++;
|
||||
}
|
||||
nvm_dynamic_keymap_read_buffer(offset, size, data);
|
||||
}
|
||||
|
||||
void dynamic_keymap_set_buffer(uint16_t offset, uint16_t size, uint8_t *data) {
|
||||
uint16_t dynamic_keymap_eeprom_size = DYNAMIC_KEYMAP_LAYER_COUNT * MATRIX_ROWS * MATRIX_COLS * 2;
|
||||
void * target = (void *)(DYNAMIC_KEYMAP_EEPROM_ADDR + offset);
|
||||
uint8_t *source = data;
|
||||
for (uint16_t i = 0; i < size; i++) {
|
||||
if (offset + i < dynamic_keymap_eeprom_size) {
|
||||
eeprom_update_byte(target, *source);
|
||||
}
|
||||
source++;
|
||||
target++;
|
||||
}
|
||||
nvm_dynamic_keymap_update_buffer(offset, size, data);
|
||||
}
|
||||
|
||||
uint16_t keycode_at_keymap_location(uint8_t layer_num, uint8_t row, uint8_t column) {
|
||||
@@ -216,53 +103,38 @@ uint8_t dynamic_keymap_macro_get_count(void) {
|
||||
}
|
||||
|
||||
uint16_t dynamic_keymap_macro_get_buffer_size(void) {
|
||||
return DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE;
|
||||
return (uint16_t)nvm_dynamic_keymap_macro_size();
|
||||
}
|
||||
|
||||
void dynamic_keymap_macro_get_buffer(uint16_t offset, uint16_t size, uint8_t *data) {
|
||||
void * source = (void *)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + offset);
|
||||
uint8_t *target = data;
|
||||
for (uint16_t i = 0; i < size; i++) {
|
||||
if (offset + i < DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE) {
|
||||
*target = eeprom_read_byte(source);
|
||||
} else {
|
||||
*target = 0x00;
|
||||
}
|
||||
source++;
|
||||
target++;
|
||||
}
|
||||
nvm_dynamic_keymap_macro_read_buffer(offset, size, data);
|
||||
}
|
||||
|
||||
void dynamic_keymap_macro_set_buffer(uint16_t offset, uint16_t size, uint8_t *data) {
|
||||
void * target = (void *)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + offset);
|
||||
uint8_t *source = data;
|
||||
for (uint16_t i = 0; i < size; i++) {
|
||||
if (offset + i < DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE) {
|
||||
eeprom_update_byte(target, *source);
|
||||
}
|
||||
source++;
|
||||
target++;
|
||||
}
|
||||
nvm_dynamic_keymap_macro_update_buffer(offset, size, data);
|
||||
}
|
||||
|
||||
typedef struct send_string_eeprom_state_t {
|
||||
const uint8_t *ptr;
|
||||
} send_string_eeprom_state_t;
|
||||
static uint8_t dynamic_keymap_read_byte(uint32_t offset) {
|
||||
uint8_t d;
|
||||
nvm_dynamic_keymap_macro_read_buffer(offset, 1, &d);
|
||||
return d;
|
||||
}
|
||||
|
||||
char send_string_get_next_eeprom(void *arg) {
|
||||
send_string_eeprom_state_t *state = (send_string_eeprom_state_t *)arg;
|
||||
char ret = eeprom_read_byte(state->ptr);
|
||||
state->ptr++;
|
||||
typedef struct send_string_nvm_state_t {
|
||||
uint32_t offset;
|
||||
} send_string_nvm_state_t;
|
||||
|
||||
char send_string_get_next_nvm(void *arg) {
|
||||
send_string_nvm_state_t *state = (send_string_nvm_state_t *)arg;
|
||||
char ret = dynamic_keymap_read_byte(state->offset);
|
||||
state->offset++;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void dynamic_keymap_macro_reset(void) {
|
||||
void *p = (void *)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR);
|
||||
void *end = (void *)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE);
|
||||
while (p != end) {
|
||||
eeprom_update_byte(p, 0);
|
||||
++p;
|
||||
}
|
||||
// Erase the macros, if necessary.
|
||||
nvm_dynamic_keymap_macro_erase();
|
||||
nvm_dynamic_keymap_macro_reset();
|
||||
}
|
||||
|
||||
void dynamic_keymap_macro_send(uint8_t id) {
|
||||
@@ -274,27 +146,26 @@ void dynamic_keymap_macro_send(uint8_t id) {
|
||||
// If it's not zero, then we are in the middle
|
||||
// of buffer writing, possibly an aborted buffer
|
||||
// write. So do nothing.
|
||||
void *p = (void *)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE - 1);
|
||||
if (eeprom_read_byte(p) != 0) {
|
||||
if (dynamic_keymap_read_byte(nvm_dynamic_keymap_macro_size() - 1) != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Skip N null characters
|
||||
// p will then point to the Nth macro
|
||||
p = (void *)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR);
|
||||
void *end = (void *)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE);
|
||||
uint32_t offset = 0;
|
||||
uint32_t end = nvm_dynamic_keymap_macro_size();
|
||||
while (id > 0) {
|
||||
// If we are past the end of the buffer, then there is
|
||||
// no Nth macro in the buffer.
|
||||
if (p == end) {
|
||||
if (offset == end) {
|
||||
return;
|
||||
}
|
||||
if (eeprom_read_byte(p) == 0) {
|
||||
if (dynamic_keymap_read_byte(offset) == 0) {
|
||||
--id;
|
||||
}
|
||||
++p;
|
||||
++offset;
|
||||
}
|
||||
|
||||
send_string_eeprom_state_t state = {p};
|
||||
send_string_with_delay_impl(send_string_get_next_eeprom, &state, DYNAMIC_KEYMAP_MACRO_DELAY);
|
||||
send_string_nvm_state_t state = {.offset = 0};
|
||||
send_string_with_delay_impl(send_string_get_next_nvm, &state, DYNAMIC_KEYMAP_MACRO_DELAY);
|
||||
}
|
||||
|
||||
@@ -18,8 +18,15 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifndef DYNAMIC_KEYMAP_LAYER_COUNT
|
||||
# define DYNAMIC_KEYMAP_LAYER_COUNT 4
|
||||
#endif
|
||||
|
||||
#ifndef DYNAMIC_KEYMAP_MACRO_COUNT
|
||||
# define DYNAMIC_KEYMAP_MACRO_COUNT 16
|
||||
#endif
|
||||
|
||||
uint8_t dynamic_keymap_get_layer_count(void);
|
||||
void * dynamic_keymap_key_to_eeprom_address(uint8_t layer, uint8_t row, uint8_t column);
|
||||
uint16_t dynamic_keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t column);
|
||||
void dynamic_keymap_set_keycode(uint8_t layer, uint8_t row, uint8_t column, uint16_t keycode);
|
||||
#ifdef ENCODER_MAP_ENABLE
|
||||
|
||||
@@ -1,355 +1,359 @@
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "eeprom.h"
|
||||
#include "debug.h"
|
||||
#include "eeconfig.h"
|
||||
#include "action_layer.h"
|
||||
#include "nvm_eeconfig.h"
|
||||
#include "keycode_config.h"
|
||||
|
||||
#if defined(EEPROM_DRIVER)
|
||||
# include "eeprom_driver.h"
|
||||
#endif
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
# include "backlight.h"
|
||||
#endif // BACKLIGHT_ENABLE
|
||||
|
||||
#if defined(HAPTIC_ENABLE)
|
||||
#ifdef AUDIO_ENABLE
|
||||
# include "audio.h"
|
||||
#endif // AUDIO_ENABLE
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
# include "rgblight.h"
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
# include "rgb_matrix_types.h"
|
||||
#endif // RGB_MATRIX_ENABLE
|
||||
|
||||
#ifdef LED_MATRIX_ENABLE
|
||||
# include "led_matrix_types.h"
|
||||
#endif // LED_MATRIX_ENABLE
|
||||
|
||||
#ifdef UNICODE_COMMON_ENABLE
|
||||
# include "unicode.h"
|
||||
#endif // UNICODE_COMMON_ENABLE
|
||||
|
||||
#ifdef HAPTIC_ENABLE
|
||||
# include "haptic.h"
|
||||
#endif
|
||||
#endif // HAPTIC_ENABLE
|
||||
|
||||
#if defined(VIA_ENABLE)
|
||||
#ifdef CONNECTION_ENABLE
|
||||
# include "connection.h"
|
||||
#endif // CONNECTION_ENABLE
|
||||
|
||||
#ifdef VIA_ENABLE
|
||||
bool via_eeprom_is_valid(void);
|
||||
void via_eeprom_set_valid(bool valid);
|
||||
void eeconfig_init_via(void);
|
||||
#else
|
||||
void dynamic_keymap_reset(void);
|
||||
#endif // VIA_ENABLE
|
||||
|
||||
#ifndef NKRO_DEFAULT_ON
|
||||
# define NKRO_DEFAULT_ON false
|
||||
#endif
|
||||
|
||||
_Static_assert((intptr_t)EECONFIG_HANDEDNESS == 14, "EEPROM handedness offset is incorrect");
|
||||
|
||||
/** \brief eeconfig enable
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
__attribute__((weak)) void eeconfig_init_user(void) {
|
||||
#if (EECONFIG_USER_DATA_SIZE) == 0
|
||||
// Reset user EEPROM value to blank, rather than to a set value
|
||||
eeconfig_update_user(0);
|
||||
#endif
|
||||
#endif // (EECONFIG_USER_DATA_SIZE) == 0
|
||||
}
|
||||
|
||||
__attribute__((weak)) void eeconfig_init_kb(void) {
|
||||
#if (EECONFIG_KB_DATA_SIZE) == 0
|
||||
// Reset Keyboard EEPROM value to blank, rather than to a set value
|
||||
eeconfig_update_kb(0);
|
||||
#endif
|
||||
#endif // (EECONFIG_KB_DATA_SIZE) == 0
|
||||
|
||||
eeconfig_init_user();
|
||||
}
|
||||
|
||||
/*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
void eeconfig_init_quantum(void) {
|
||||
#if defined(EEPROM_DRIVER)
|
||||
eeprom_driver_format(false);
|
||||
#endif
|
||||
nvm_eeconfig_erase();
|
||||
|
||||
eeconfig_enable();
|
||||
|
||||
debug_config_t debug_config = {0};
|
||||
eeconfig_update_debug(&debug_config);
|
||||
|
||||
eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
|
||||
eeprom_update_byte(EECONFIG_DEBUG, 0);
|
||||
default_layer_state = (layer_state_t)1 << 0;
|
||||
eeconfig_update_default_layer(default_layer_state);
|
||||
// Enable oneshot and autocorrect by default: 0b0001 0100 0000 0000
|
||||
eeprom_update_word(EECONFIG_KEYMAP, 0x1400);
|
||||
eeprom_update_byte(EECONFIG_BACKLIGHT, 0);
|
||||
eeprom_update_byte(EECONFIG_AUDIO, 0);
|
||||
eeprom_update_dword(EECONFIG_RGBLIGHT, 0);
|
||||
eeprom_update_byte(EECONFIG_RGBLIGHT_EXTENDED, 0);
|
||||
eeprom_update_byte(EECONFIG_UNICODEMODE, 0);
|
||||
eeprom_update_byte(EECONFIG_STENOMODE, 0);
|
||||
eeprom_write_qword(EECONFIG_RGB_MATRIX, 0);
|
||||
eeprom_update_dword(EECONFIG_HAPTIC, 0);
|
||||
#if defined(HAPTIC_ENABLE)
|
||||
haptic_reset();
|
||||
|
||||
keymap_config_t keymap_config = {
|
||||
.swap_control_capslock = false,
|
||||
.capslock_to_control = false,
|
||||
.swap_lalt_lgui = false,
|
||||
.swap_ralt_rgui = false,
|
||||
.no_gui = false,
|
||||
.swap_grave_esc = false,
|
||||
.swap_backslash_backspace = false,
|
||||
.nkro = NKRO_DEFAULT_ON,
|
||||
.swap_lctl_lgui = false,
|
||||
.swap_rctl_rgui = false,
|
||||
.oneshot_enable = true, // Enable oneshot by default
|
||||
.swap_escape_capslock = false,
|
||||
.autocorrect_enable = true, // Enable autocorrect by default
|
||||
};
|
||||
eeconfig_update_keymap(&keymap_config);
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
backlight_config_t backlight_config = {0};
|
||||
eeconfig_update_backlight(&backlight_config);
|
||||
#endif // BACKLIGHT_ENABLE
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
audio_config_t audio_config = {0};
|
||||
eeconfig_update_audio(&audio_config);
|
||||
#endif // AUDIO_ENABLE
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
extern void eeconfig_update_rgblight_default(void);
|
||||
eeconfig_update_rgblight_default();
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
|
||||
#ifdef UNICODE_COMMON_ENABLE
|
||||
unicode_config_t unicode_config = {0};
|
||||
eeconfig_update_unicode_mode(&unicode_config);
|
||||
#endif // UNICODE_COMMON_ENABLE
|
||||
|
||||
#ifdef STENO_ENABLE
|
||||
eeconfig_update_steno_mode(0);
|
||||
#endif // STENO_ENABLE
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
extern void eeconfig_update_rgb_matrix_default(void);
|
||||
eeconfig_update_rgb_matrix_default();
|
||||
#endif
|
||||
|
||||
#ifdef LED_MATRIX_ENABLE
|
||||
extern void eeconfig_update_led_matrix_default(void);
|
||||
eeconfig_update_led_matrix_default();
|
||||
#endif // LED_MATRIX_ENABLE
|
||||
|
||||
#ifdef HAPTIC_ENABLE
|
||||
haptic_config_t haptic_config = {0};
|
||||
eeconfig_update_haptic(&haptic_config);
|
||||
haptic_reset();
|
||||
#endif // HAPTIC_ENABLE
|
||||
|
||||
#ifdef CONNECTION_ENABLE
|
||||
extern void eeconfig_update_connection_default(void);
|
||||
eeconfig_update_connection_default();
|
||||
#endif // CONNECTION_ENABLE
|
||||
|
||||
#if (EECONFIG_KB_DATA_SIZE) > 0
|
||||
eeconfig_init_kb_datablock();
|
||||
#endif
|
||||
#endif // (EECONFIG_KB_DATA_SIZE) > 0
|
||||
|
||||
#if (EECONFIG_USER_DATA_SIZE) > 0
|
||||
eeconfig_init_user_datablock();
|
||||
#endif
|
||||
#endif // (EECONFIG_USER_DATA_SIZE) > 0
|
||||
|
||||
#if defined(VIA_ENABLE)
|
||||
// Invalidate VIA eeprom config, and then reset.
|
||||
// Just in case if power is lost mid init, this makes sure that it pets
|
||||
// Just in case if power is lost mid init, this makes sure that it gets
|
||||
// properly re-initialized.
|
||||
via_eeprom_set_valid(false);
|
||||
eeconfig_init_via();
|
||||
#elif defined(DYNAMIC_KEYMAP_ENABLE)
|
||||
dynamic_keymap_reset();
|
||||
#endif
|
||||
|
||||
eeconfig_init_kb();
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
extern void eeconfig_force_flush_rgb_matrix(void);
|
||||
eeconfig_force_flush_rgb_matrix();
|
||||
#endif // RGB_MATRIX_ENABLE
|
||||
#ifdef LED_MATRIX_ENABLE
|
||||
extern void eeconfig_force_flush_led_matrix(void);
|
||||
eeconfig_force_flush_led_matrix();
|
||||
#endif // LED_MATRIX_ENABLE
|
||||
}
|
||||
|
||||
/** \brief eeconfig initialization
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
void eeconfig_init(void) {
|
||||
eeconfig_init_quantum();
|
||||
}
|
||||
|
||||
/** \brief eeconfig enable
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
void eeconfig_enable(void) {
|
||||
eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
|
||||
nvm_eeconfig_enable();
|
||||
}
|
||||
|
||||
/** \brief eeconfig disable
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
void eeconfig_disable(void) {
|
||||
#if defined(EEPROM_DRIVER)
|
||||
eeprom_driver_format(false);
|
||||
#endif
|
||||
eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER_OFF);
|
||||
nvm_eeconfig_disable();
|
||||
}
|
||||
|
||||
/** \brief eeconfig is enabled
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
bool eeconfig_is_enabled(void) {
|
||||
bool is_eeprom_enabled = (eeprom_read_word(EECONFIG_MAGIC) == EECONFIG_MAGIC_NUMBER);
|
||||
bool is_eeprom_enabled = nvm_eeconfig_is_enabled();
|
||||
#ifdef VIA_ENABLE
|
||||
if (is_eeprom_enabled) {
|
||||
is_eeprom_enabled = via_eeprom_is_valid();
|
||||
}
|
||||
#endif
|
||||
#endif // VIA_ENABLE
|
||||
return is_eeprom_enabled;
|
||||
}
|
||||
|
||||
/** \brief eeconfig is disabled
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
bool eeconfig_is_disabled(void) {
|
||||
bool is_eeprom_disabled = (eeprom_read_word(EECONFIG_MAGIC) == EECONFIG_MAGIC_NUMBER_OFF);
|
||||
bool is_eeprom_disabled = nvm_eeconfig_is_disabled();
|
||||
#ifdef VIA_ENABLE
|
||||
if (!is_eeprom_disabled) {
|
||||
is_eeprom_disabled = !via_eeprom_is_valid();
|
||||
}
|
||||
#endif
|
||||
#endif // VIA_ENABLE
|
||||
return is_eeprom_disabled;
|
||||
}
|
||||
|
||||
/** \brief eeconfig read debug
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
uint8_t eeconfig_read_debug(void) {
|
||||
return eeprom_read_byte(EECONFIG_DEBUG);
|
||||
void eeconfig_read_debug(debug_config_t *debug_config) {
|
||||
nvm_eeconfig_read_debug(debug_config);
|
||||
}
|
||||
/** \brief eeconfig update debug
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
void eeconfig_update_debug(uint8_t val) {
|
||||
eeprom_update_byte(EECONFIG_DEBUG, val);
|
||||
void eeconfig_update_debug(const debug_config_t *debug_config) {
|
||||
nvm_eeconfig_update_debug(debug_config);
|
||||
}
|
||||
|
||||
/** \brief eeconfig read default layer
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
layer_state_t eeconfig_read_default_layer(void) {
|
||||
uint8_t val = eeprom_read_byte(EECONFIG_DEFAULT_LAYER);
|
||||
|
||||
#ifdef DEFAULT_LAYER_STATE_IS_VALUE_NOT_BITMASK
|
||||
// stored as a layer number, so convert back to bitmask
|
||||
return 1 << val;
|
||||
#else
|
||||
// stored as 8-bit-wide bitmask, so read the value directly - handling padding to 16/32 bit layer_state_t
|
||||
return val;
|
||||
#endif
|
||||
return nvm_eeconfig_read_default_layer();
|
||||
}
|
||||
/** \brief eeconfig update default layer
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
void eeconfig_update_default_layer(layer_state_t state) {
|
||||
#ifdef DEFAULT_LAYER_STATE_IS_VALUE_NOT_BITMASK
|
||||
// stored as a layer number, so only store the highest layer
|
||||
uint8_t val = get_highest_layer(state);
|
||||
#else
|
||||
// stored as 8-bit-wide bitmask, so write the value directly - handling truncation from 16/32 bit layer_state_t
|
||||
uint8_t val = state;
|
||||
#endif
|
||||
|
||||
eeprom_update_byte(EECONFIG_DEFAULT_LAYER, val);
|
||||
nvm_eeconfig_update_default_layer(state);
|
||||
}
|
||||
|
||||
/** \brief eeconfig read keymap
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
uint16_t eeconfig_read_keymap(void) {
|
||||
return eeprom_read_word(EECONFIG_KEYMAP);
|
||||
void eeconfig_read_keymap(keymap_config_t *keymap_config) {
|
||||
nvm_eeconfig_read_keymap(keymap_config);
|
||||
}
|
||||
/** \brief eeconfig update keymap
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
void eeconfig_update_keymap(uint16_t val) {
|
||||
eeprom_update_word(EECONFIG_KEYMAP, val);
|
||||
void eeconfig_update_keymap(const keymap_config_t *keymap_config) {
|
||||
nvm_eeconfig_update_keymap(keymap_config);
|
||||
}
|
||||
|
||||
/** \brief eeconfig read audio
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
uint8_t eeconfig_read_audio(void) {
|
||||
return eeprom_read_byte(EECONFIG_AUDIO);
|
||||
#ifdef AUDIO_ENABLE
|
||||
void eeconfig_read_audio(audio_config_t *audio_config) {
|
||||
nvm_eeconfig_read_audio(audio_config);
|
||||
}
|
||||
/** \brief eeconfig update audio
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
void eeconfig_update_audio(uint8_t val) {
|
||||
eeprom_update_byte(EECONFIG_AUDIO, val);
|
||||
void eeconfig_update_audio(const audio_config_t *audio_config) {
|
||||
nvm_eeconfig_update_audio(audio_config);
|
||||
}
|
||||
#endif // AUDIO_ENABLE
|
||||
|
||||
#ifdef UNICODE_COMMON_ENABLE
|
||||
void eeconfig_read_unicode_mode(unicode_config_t *unicode_config) {
|
||||
return nvm_eeconfig_read_unicode_mode(unicode_config);
|
||||
}
|
||||
void eeconfig_update_unicode_mode(const unicode_config_t *unicode_config) {
|
||||
nvm_eeconfig_update_unicode_mode(unicode_config);
|
||||
}
|
||||
#endif // UNICODE_COMMON_ENABLE
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
void eeconfig_read_backlight(backlight_config_t *backlight_config) {
|
||||
nvm_eeconfig_read_backlight(backlight_config);
|
||||
}
|
||||
void eeconfig_update_backlight(const backlight_config_t *backlight_config) {
|
||||
nvm_eeconfig_update_backlight(backlight_config);
|
||||
}
|
||||
#endif // BACKLIGHT_ENABLE
|
||||
|
||||
#ifdef STENO_ENABLE
|
||||
uint8_t eeconfig_read_steno_mode(void) {
|
||||
return nvm_eeconfig_read_steno_mode();
|
||||
}
|
||||
void eeconfig_update_steno_mode(uint8_t val) {
|
||||
nvm_eeconfig_update_steno_mode(val);
|
||||
}
|
||||
#endif // STENO_ENABLE
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
void eeconfig_read_rgb_matrix(rgb_config_t *rgb_matrix_config) {
|
||||
nvm_eeconfig_read_rgb_matrix(rgb_matrix_config);
|
||||
}
|
||||
void eeconfig_update_rgb_matrix(const rgb_config_t *rgb_matrix_config) {
|
||||
nvm_eeconfig_update_rgb_matrix(rgb_matrix_config);
|
||||
}
|
||||
#endif // RGB_MATRIX_ENABLE
|
||||
|
||||
#ifdef LED_MATRIX_ENABLE
|
||||
void eeconfig_read_led_matrix(led_eeconfig_t *led_matrix_config) {
|
||||
nvm_eeconfig_read_led_matrix(led_matrix_config);
|
||||
}
|
||||
void eeconfig_update_led_matrix(const led_eeconfig_t *led_matrix_config) {
|
||||
nvm_eeconfig_update_led_matrix(led_matrix_config);
|
||||
}
|
||||
#endif // LED_MATRIX_ENABLE
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
void eeconfig_read_rgblight(rgblight_config_t *rgblight_config) {
|
||||
nvm_eeconfig_read_rgblight(rgblight_config);
|
||||
}
|
||||
void eeconfig_update_rgblight(const rgblight_config_t *rgblight_config) {
|
||||
nvm_eeconfig_update_rgblight(rgblight_config);
|
||||
}
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
|
||||
#if (EECONFIG_KB_DATA_SIZE) == 0
|
||||
/** \brief eeconfig read kb
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
uint32_t eeconfig_read_kb(void) {
|
||||
return eeprom_read_dword(EECONFIG_KEYBOARD);
|
||||
return nvm_eeconfig_read_kb();
|
||||
}
|
||||
/** \brief eeconfig update kb
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
void eeconfig_update_kb(uint32_t val) {
|
||||
eeprom_update_dword(EECONFIG_KEYBOARD, val);
|
||||
nvm_eeconfig_update_kb(val);
|
||||
}
|
||||
#endif // (EECONFIG_KB_DATA_SIZE) == 0
|
||||
|
||||
#if (EECONFIG_USER_DATA_SIZE) == 0
|
||||
/** \brief eeconfig read user
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
uint32_t eeconfig_read_user(void) {
|
||||
return eeprom_read_dword(EECONFIG_USER);
|
||||
return nvm_eeconfig_read_user();
|
||||
}
|
||||
/** \brief eeconfig update user
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
void eeconfig_update_user(uint32_t val) {
|
||||
eeprom_update_dword(EECONFIG_USER, val);
|
||||
nvm_eeconfig_update_user(val);
|
||||
}
|
||||
#endif // (EECONFIG_USER_DATA_SIZE) == 0
|
||||
|
||||
/** \brief eeconfig read haptic
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
uint32_t eeconfig_read_haptic(void) {
|
||||
return eeprom_read_dword(EECONFIG_HAPTIC);
|
||||
#ifdef HAPTIC_ENABLE
|
||||
void eeconfig_read_haptic(haptic_config_t *haptic_config) {
|
||||
nvm_eeconfig_read_haptic(haptic_config);
|
||||
}
|
||||
/** \brief eeconfig update haptic
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
void eeconfig_update_haptic(uint32_t val) {
|
||||
eeprom_update_dword(EECONFIG_HAPTIC, val);
|
||||
void eeconfig_update_haptic(const haptic_config_t *haptic_config) {
|
||||
nvm_eeconfig_update_haptic(haptic_config);
|
||||
}
|
||||
#endif // HAPTIC_ENABLE
|
||||
|
||||
/** \brief eeconfig read split handedness
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
bool eeconfig_read_handedness(void) {
|
||||
return !!eeprom_read_byte(EECONFIG_HANDEDNESS);
|
||||
#ifdef CONNECTION_ENABLE
|
||||
void eeconfig_read_connection(connection_config_t *config) {
|
||||
nvm_eeconfig_read_connection(config);
|
||||
}
|
||||
void eeconfig_update_connection(const connection_config_t *config) {
|
||||
nvm_eeconfig_update_connection(config);
|
||||
}
|
||||
#endif // CONNECTION_ENABLE
|
||||
|
||||
bool eeconfig_read_handedness(void) {
|
||||
return nvm_eeconfig_read_handedness();
|
||||
}
|
||||
/** \brief eeconfig update split handedness
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
void eeconfig_update_handedness(bool val) {
|
||||
eeprom_update_byte(EECONFIG_HANDEDNESS, !!val);
|
||||
nvm_eeconfig_update_handedness(val);
|
||||
}
|
||||
|
||||
#if (EECONFIG_KB_DATA_SIZE) > 0
|
||||
/** \brief eeconfig assert keyboard data block version
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
bool eeconfig_is_kb_datablock_valid(void) {
|
||||
return eeprom_read_dword(EECONFIG_KEYBOARD) == (EECONFIG_KB_DATA_VERSION);
|
||||
return nvm_eeconfig_is_kb_datablock_valid();
|
||||
}
|
||||
/** \brief eeconfig read keyboard data block
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
void eeconfig_read_kb_datablock(void *data) {
|
||||
if (eeconfig_is_kb_datablock_valid()) {
|
||||
eeprom_read_block(data, EECONFIG_KB_DATABLOCK, (EECONFIG_KB_DATA_SIZE));
|
||||
} else {
|
||||
memset(data, 0, (EECONFIG_KB_DATA_SIZE));
|
||||
}
|
||||
uint32_t eeconfig_read_kb_datablock(void *data, uint32_t offset, uint32_t length) {
|
||||
return nvm_eeconfig_read_kb_datablock(data, offset, length);
|
||||
}
|
||||
/** \brief eeconfig update keyboard data block
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
void eeconfig_update_kb_datablock(const void *data) {
|
||||
eeprom_update_dword(EECONFIG_KEYBOARD, (EECONFIG_KB_DATA_VERSION));
|
||||
eeprom_update_block(data, EECONFIG_KB_DATABLOCK, (EECONFIG_KB_DATA_SIZE));
|
||||
uint32_t eeconfig_update_kb_datablock(const void *data, uint32_t offset, uint32_t length) {
|
||||
return nvm_eeconfig_update_kb_datablock(data, offset, length);
|
||||
}
|
||||
/** \brief eeconfig init keyboard data block
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
__attribute__((weak)) void eeconfig_init_kb_datablock(void) {
|
||||
uint8_t dummy_kb[(EECONFIG_KB_DATA_SIZE)] = {0};
|
||||
eeconfig_update_kb_datablock(dummy_kb);
|
||||
nvm_eeconfig_init_kb_datablock();
|
||||
}
|
||||
#endif // (EECONFIG_KB_DATA_SIZE) > 0
|
||||
|
||||
#if (EECONFIG_USER_DATA_SIZE) > 0
|
||||
/** \brief eeconfig assert user data block version
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
bool eeconfig_is_user_datablock_valid(void) {
|
||||
return eeprom_read_dword(EECONFIG_USER) == (EECONFIG_USER_DATA_VERSION);
|
||||
return nvm_eeconfig_is_user_datablock_valid();
|
||||
}
|
||||
/** \brief eeconfig read user data block
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
void eeconfig_read_user_datablock(void *data) {
|
||||
if (eeconfig_is_user_datablock_valid()) {
|
||||
eeprom_read_block(data, EECONFIG_USER_DATABLOCK, (EECONFIG_USER_DATA_SIZE));
|
||||
} else {
|
||||
memset(data, 0, (EECONFIG_USER_DATA_SIZE));
|
||||
}
|
||||
uint32_t eeconfig_read_user_datablock(void *data, uint32_t offset, uint32_t length) {
|
||||
return nvm_eeconfig_read_user_datablock(data, offset, length);
|
||||
}
|
||||
/** \brief eeconfig update user data block
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
void eeconfig_update_user_datablock(const void *data) {
|
||||
eeprom_update_dword(EECONFIG_USER, (EECONFIG_USER_DATA_VERSION));
|
||||
eeprom_update_block(data, EECONFIG_USER_DATABLOCK, (EECONFIG_USER_DATA_SIZE));
|
||||
uint32_t eeconfig_update_user_datablock(const void *data, uint32_t offset, uint32_t length) {
|
||||
return nvm_eeconfig_update_user_datablock(data, offset, length);
|
||||
}
|
||||
/** \brief eeconfig init user data block
|
||||
*
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
__attribute__((weak)) void eeconfig_init_user_datablock(void) {
|
||||
uint8_t dummy_user[(EECONFIG_USER_DATA_SIZE)] = {0};
|
||||
eeconfig_update_user_datablock(dummy_user);
|
||||
nvm_eeconfig_init_user_datablock();
|
||||
}
|
||||
#endif // (EECONFIG_USER_DATA_SIZE) > 0
|
||||
|
||||
@@ -19,59 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h> // offsetof
|
||||
#include "eeprom.h"
|
||||
#include "util.h"
|
||||
#include <stddef.h> // offsetof
|
||||
#include "action_layer.h" // layer_state_t
|
||||
|
||||
#ifndef EECONFIG_MAGIC_NUMBER
|
||||
# define EECONFIG_MAGIC_NUMBER (uint16_t)0xFEE5 // When changing, decrement this value to avoid future re-init issues
|
||||
#endif
|
||||
#define EECONFIG_MAGIC_NUMBER_OFF (uint16_t)0xFFFF
|
||||
|
||||
// Dummy struct only used to calculate offsets
|
||||
typedef struct PACKED {
|
||||
uint16_t magic;
|
||||
uint8_t debug;
|
||||
uint8_t default_layer;
|
||||
uint16_t keymap;
|
||||
uint8_t backlight;
|
||||
uint8_t audio;
|
||||
uint32_t rgblight;
|
||||
uint8_t unicode;
|
||||
uint8_t steno;
|
||||
uint8_t handedness;
|
||||
uint32_t keyboard;
|
||||
uint32_t user;
|
||||
union { // Mutually exclusive
|
||||
uint32_t led_matrix;
|
||||
uint64_t rgb_matrix;
|
||||
};
|
||||
uint32_t haptic;
|
||||
uint8_t rgblight_ext;
|
||||
} eeprom_core_t;
|
||||
|
||||
/* EEPROM parameter address */
|
||||
#define EECONFIG_MAGIC (uint16_t *)(offsetof(eeprom_core_t, magic))
|
||||
#define EECONFIG_DEBUG (uint8_t *)(offsetof(eeprom_core_t, debug))
|
||||
#define EECONFIG_DEFAULT_LAYER (uint8_t *)(offsetof(eeprom_core_t, default_layer))
|
||||
#define EECONFIG_KEYMAP (uint16_t *)(offsetof(eeprom_core_t, keymap))
|
||||
#define EECONFIG_BACKLIGHT (uint8_t *)(offsetof(eeprom_core_t, backlight))
|
||||
#define EECONFIG_AUDIO (uint8_t *)(offsetof(eeprom_core_t, audio))
|
||||
#define EECONFIG_RGBLIGHT (uint32_t *)(offsetof(eeprom_core_t, rgblight))
|
||||
#define EECONFIG_UNICODEMODE (uint8_t *)(offsetof(eeprom_core_t, unicode))
|
||||
#define EECONFIG_STENOMODE (uint8_t *)(offsetof(eeprom_core_t, steno))
|
||||
#define EECONFIG_HANDEDNESS (uint8_t *)(offsetof(eeprom_core_t, handedness))
|
||||
#define EECONFIG_KEYBOARD (uint32_t *)(offsetof(eeprom_core_t, keyboard))
|
||||
#define EECONFIG_USER (uint32_t *)(offsetof(eeprom_core_t, user))
|
||||
#define EECONFIG_LED_MATRIX (uint32_t *)(offsetof(eeprom_core_t, led_matrix))
|
||||
#define EECONFIG_RGB_MATRIX (uint64_t *)(offsetof(eeprom_core_t, rgb_matrix))
|
||||
#define EECONFIG_HAPTIC (uint32_t *)(offsetof(eeprom_core_t, haptic))
|
||||
#define EECONFIG_RGBLIGHT_EXTENDED (uint8_t *)(offsetof(eeprom_core_t, rgblight_ext))
|
||||
|
||||
// Size of EEPROM being used for core data storage
|
||||
#define EECONFIG_BASE_SIZE ((uint8_t)sizeof(eeprom_core_t))
|
||||
|
||||
// Size of EEPROM dedicated to keyboard- and user-specific data
|
||||
#ifndef EECONFIG_KB_DATA_SIZE
|
||||
# define EECONFIG_KB_DATA_SIZE 0
|
||||
@@ -86,12 +36,6 @@ typedef struct PACKED {
|
||||
# define EECONFIG_USER_DATA_VERSION (EECONFIG_USER_DATA_SIZE)
|
||||
#endif
|
||||
|
||||
#define EECONFIG_KB_DATABLOCK ((uint8_t *)(EECONFIG_BASE_SIZE))
|
||||
#define EECONFIG_USER_DATABLOCK ((uint8_t *)((EECONFIG_BASE_SIZE) + (EECONFIG_KB_DATA_SIZE)))
|
||||
|
||||
// Size of EEPROM being used, other code can refer to this for available EEPROM
|
||||
#define EECONFIG_SIZE ((EECONFIG_BASE_SIZE) + (EECONFIG_KB_DATA_SIZE) + (EECONFIG_USER_DATA_SIZE))
|
||||
|
||||
/* debug bit */
|
||||
#define EECONFIG_DEBUG_ENABLE (1 << 0)
|
||||
#define EECONFIG_DEBUG_MATRIX (1 << 1)
|
||||
@@ -117,22 +61,59 @@ void eeconfig_init_kb(void);
|
||||
void eeconfig_init_user(void);
|
||||
|
||||
void eeconfig_enable(void);
|
||||
|
||||
void eeconfig_disable(void);
|
||||
|
||||
uint8_t eeconfig_read_debug(void);
|
||||
void eeconfig_update_debug(uint8_t val);
|
||||
typedef union debug_config_t debug_config_t;
|
||||
void eeconfig_read_debug(debug_config_t *debug_config) __attribute__((nonnull));
|
||||
void eeconfig_update_debug(const debug_config_t *debug_config) __attribute__((nonnull));
|
||||
|
||||
layer_state_t eeconfig_read_default_layer(void);
|
||||
void eeconfig_update_default_layer(layer_state_t val);
|
||||
void eeconfig_update_default_layer(layer_state_t state);
|
||||
|
||||
uint16_t eeconfig_read_keymap(void);
|
||||
void eeconfig_update_keymap(uint16_t val);
|
||||
typedef union keymap_config_t keymap_config_t;
|
||||
void eeconfig_read_keymap(keymap_config_t *keymap_config) __attribute__((nonnull));
|
||||
void eeconfig_update_keymap(const keymap_config_t *keymap_config) __attribute__((nonnull));
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
uint8_t eeconfig_read_audio(void);
|
||||
void eeconfig_update_audio(uint8_t val);
|
||||
#endif
|
||||
typedef union audio_config_t audio_config_t;
|
||||
void eeconfig_read_audio(audio_config_t *audio_config) __attribute__((nonnull));
|
||||
void eeconfig_update_audio(const audio_config_t *audio_config) __attribute__((nonnull));
|
||||
#endif // AUDIO_ENABLE
|
||||
|
||||
#ifdef UNICODE_COMMON_ENABLE
|
||||
typedef union unicode_config_t unicode_config_t;
|
||||
void eeconfig_read_unicode_mode(unicode_config_t *unicode_config) __attribute__((nonnull));
|
||||
void eeconfig_update_unicode_mode(const unicode_config_t *unicode_config) __attribute__((nonnull));
|
||||
#endif // UNICODE_COMMON_ENABLE
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
typedef union backlight_config_t backlight_config_t;
|
||||
void eeconfig_read_backlight(backlight_config_t *backlight_config) __attribute__((nonnull));
|
||||
void eeconfig_update_backlight(const backlight_config_t *backlight_config) __attribute__((nonnull));
|
||||
#endif // BACKLIGHT_ENABLE
|
||||
|
||||
#ifdef STENO_ENABLE
|
||||
uint8_t eeconfig_read_steno_mode(void);
|
||||
void eeconfig_update_steno_mode(uint8_t val);
|
||||
#endif // STENO_ENABLE
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
typedef union rgb_config_t rgb_config_t;
|
||||
void eeconfig_read_rgb_matrix(rgb_config_t *rgb_matrix_config) __attribute__((nonnull));
|
||||
void eeconfig_update_rgb_matrix(const rgb_config_t *rgb_matrix_config) __attribute__((nonnull));
|
||||
#endif // RGB_MATRIX_ENABLE
|
||||
|
||||
#ifdef LED_MATRIX_ENABLE
|
||||
typedef union led_eeconfig_t led_eeconfig_t;
|
||||
void eeconfig_read_led_matrix(led_eeconfig_t *led_matrix_config) __attribute__((nonnull));
|
||||
void eeconfig_update_led_matrix(const led_eeconfig_t *led_matrix_config) __attribute__((nonnull));
|
||||
#endif // LED_MATRIX_ENABLE
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
typedef union rgblight_config_t rgblight_config_t;
|
||||
void eeconfig_read_rgblight(rgblight_config_t *rgblight_config) __attribute__((nonnull));
|
||||
void eeconfig_update_rgblight(const rgblight_config_t *rgblight_config) __attribute__((nonnull));
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
|
||||
#if (EECONFIG_KB_DATA_SIZE) == 0
|
||||
uint32_t eeconfig_read_kb(void);
|
||||
@@ -145,31 +126,42 @@ void eeconfig_update_user(uint32_t val);
|
||||
#endif // (EECONFIG_USER_DATA_SIZE) == 0
|
||||
|
||||
#ifdef HAPTIC_ENABLE
|
||||
uint32_t eeconfig_read_haptic(void);
|
||||
void eeconfig_update_haptic(uint32_t val);
|
||||
typedef union haptic_config_t haptic_config_t;
|
||||
void eeconfig_read_haptic(haptic_config_t *haptic_config) __attribute__((nonnull));
|
||||
void eeconfig_update_haptic(const haptic_config_t *haptic_config) __attribute__((nonnull));
|
||||
#endif
|
||||
|
||||
#ifdef CONNECTION_ENABLE
|
||||
typedef union connection_config_t connection_config_t;
|
||||
void eeconfig_read_connection(connection_config_t *config);
|
||||
void eeconfig_update_connection(const connection_config_t *config);
|
||||
#endif
|
||||
|
||||
bool eeconfig_read_handedness(void);
|
||||
void eeconfig_update_handedness(bool val);
|
||||
|
||||
#if (EECONFIG_KB_DATA_SIZE) > 0
|
||||
bool eeconfig_is_kb_datablock_valid(void);
|
||||
void eeconfig_read_kb_datablock(void *data);
|
||||
void eeconfig_update_kb_datablock(const void *data);
|
||||
void eeconfig_init_kb_datablock(void);
|
||||
bool eeconfig_is_kb_datablock_valid(void);
|
||||
uint32_t eeconfig_read_kb_datablock(void *data, uint32_t offset, uint32_t length) __attribute__((nonnull));
|
||||
uint32_t eeconfig_update_kb_datablock(const void *data, uint32_t offset, uint32_t length) __attribute__((nonnull));
|
||||
void eeconfig_init_kb_datablock(void);
|
||||
# define eeconfig_read_kb_datablock_field(__object, __field) eeconfig_read_kb_datablock(&(__object.__field), offsetof(typeof(__object), __field), sizeof(__object.__field))
|
||||
# define eeconfig_update_kb_datablock_field(__object, __field) eeconfig_update_kb_datablock(&(__object.__field), offsetof(typeof(__object), __field), sizeof(__object.__field))
|
||||
#endif // (EECONFIG_KB_DATA_SIZE) > 0
|
||||
|
||||
#if (EECONFIG_USER_DATA_SIZE) > 0
|
||||
bool eeconfig_is_user_datablock_valid(void);
|
||||
void eeconfig_read_user_datablock(void *data);
|
||||
void eeconfig_update_user_datablock(const void *data);
|
||||
void eeconfig_init_user_datablock(void);
|
||||
bool eeconfig_is_user_datablock_valid(void);
|
||||
uint32_t eeconfig_read_user_datablock(void *data, uint32_t offset, uint32_t length) __attribute__((nonnull));
|
||||
uint32_t eeconfig_update_user_datablock(const void *data, uint32_t offset, uint32_t length) __attribute__((nonnull));
|
||||
void eeconfig_init_user_datablock(void);
|
||||
# define eeconfig_read_user_datablock_field(__object, __field) eeconfig_read_user_datablock(&(__object.__field), offsetof(__object, __field), sizeof(__object.__field))
|
||||
# define eeconfig_update_user_datablock_field(__object, __field) eeconfig_update_user_datablock(&(__object.__field), offsetof(__object, __field), sizeof(__object.__field))
|
||||
#endif // (EECONFIG_USER_DATA_SIZE) > 0
|
||||
|
||||
// Any "checked" debounce variant used requires implementation of:
|
||||
// -- bool eeconfig_check_valid_##name(void)
|
||||
// -- void eeconfig_post_flush_##name(void)
|
||||
#define EECONFIG_DEBOUNCE_HELPER_CHECKED(name, offset, config) \
|
||||
#define EECONFIG_DEBOUNCE_HELPER_CHECKED(name, config) \
|
||||
static uint8_t dirty_##name = false; \
|
||||
\
|
||||
bool eeconfig_check_valid_##name(void); \
|
||||
@@ -178,13 +170,13 @@ void eeconfig_init_user_datablock(void);
|
||||
static inline void eeconfig_init_##name(void) { \
|
||||
dirty_##name = true; \
|
||||
if (eeconfig_check_valid_##name()) { \
|
||||
eeprom_read_block(&config, offset, sizeof(config)); \
|
||||
eeconfig_read_##name(&config); \
|
||||
dirty_##name = false; \
|
||||
} \
|
||||
} \
|
||||
static inline void eeconfig_flush_##name(bool force) { \
|
||||
if (force || dirty_##name) { \
|
||||
eeprom_update_block(&config, offset, sizeof(config)); \
|
||||
eeconfig_update_##name(&config); \
|
||||
eeconfig_post_flush_##name(); \
|
||||
dirty_##name = false; \
|
||||
} \
|
||||
@@ -206,10 +198,10 @@ void eeconfig_init_user_datablock(void);
|
||||
} \
|
||||
}
|
||||
|
||||
#define EECONFIG_DEBOUNCE_HELPER(name, offset, config) \
|
||||
EECONFIG_DEBOUNCE_HELPER_CHECKED(name, offset, config) \
|
||||
\
|
||||
bool eeconfig_check_valid_##name(void) { \
|
||||
return true; \
|
||||
} \
|
||||
#define EECONFIG_DEBOUNCE_HELPER(name, config) \
|
||||
EECONFIG_DEBOUNCE_HELPER_CHECKED(name, config) \
|
||||
\
|
||||
bool eeconfig_check_valid_##name(void) { \
|
||||
return true; \
|
||||
} \
|
||||
void eeconfig_post_flush_##name(void) {}
|
||||
|
||||
@@ -67,7 +67,7 @@ void haptic_init(void) {
|
||||
if (!eeconfig_is_enabled()) {
|
||||
eeconfig_init();
|
||||
}
|
||||
haptic_config.raw = eeconfig_read_haptic();
|
||||
eeconfig_read_haptic(&haptic_config);
|
||||
#ifdef HAPTIC_SOLENOID
|
||||
solenoid_set_dwell(haptic_config.dwell);
|
||||
#endif
|
||||
@@ -122,13 +122,13 @@ void eeconfig_debug_haptic(void) {
|
||||
void haptic_enable(void) {
|
||||
set_haptic_config_enable(true);
|
||||
dprintf("haptic_config.enable = %u\n", haptic_config.enable);
|
||||
eeconfig_update_haptic(haptic_config.raw);
|
||||
eeconfig_update_haptic(&haptic_config);
|
||||
}
|
||||
|
||||
void haptic_disable(void) {
|
||||
set_haptic_config_enable(false);
|
||||
dprintf("haptic_config.enable = %u\n", haptic_config.enable);
|
||||
eeconfig_update_haptic(haptic_config.raw);
|
||||
eeconfig_update_haptic(&haptic_config);
|
||||
}
|
||||
|
||||
void haptic_toggle(void) {
|
||||
@@ -137,14 +137,14 @@ void haptic_toggle(void) {
|
||||
} else {
|
||||
haptic_enable();
|
||||
}
|
||||
eeconfig_update_haptic(haptic_config.raw);
|
||||
eeconfig_update_haptic(&haptic_config);
|
||||
}
|
||||
|
||||
void haptic_feedback_toggle(void) {
|
||||
haptic_config.feedback++;
|
||||
if (haptic_config.feedback >= HAPTIC_FEEDBACK_MAX) haptic_config.feedback = KEY_PRESS;
|
||||
dprintf("haptic_config.feedback = %u\n", !haptic_config.feedback);
|
||||
eeconfig_update_haptic(haptic_config.raw);
|
||||
eeconfig_update_haptic(&haptic_config);
|
||||
}
|
||||
|
||||
void haptic_buzz_toggle(void) {
|
||||
@@ -225,26 +225,26 @@ void haptic_reset(void) {
|
||||
haptic_config.dwell = 0;
|
||||
haptic_config.buzz = 0;
|
||||
#endif
|
||||
eeconfig_update_haptic(haptic_config.raw);
|
||||
eeconfig_update_haptic(&haptic_config);
|
||||
dprintf("haptic_config.feedback = %u\n", haptic_config.feedback);
|
||||
dprintf("haptic_config.mode = %u\n", haptic_config.mode);
|
||||
}
|
||||
|
||||
void haptic_set_feedback(uint8_t feedback) {
|
||||
haptic_config.feedback = feedback;
|
||||
eeconfig_update_haptic(haptic_config.raw);
|
||||
eeconfig_update_haptic(&haptic_config);
|
||||
dprintf("haptic_config.feedback = %u\n", haptic_config.feedback);
|
||||
}
|
||||
|
||||
void haptic_set_mode(uint8_t mode) {
|
||||
haptic_config.mode = mode;
|
||||
eeconfig_update_haptic(haptic_config.raw);
|
||||
eeconfig_update_haptic(&haptic_config);
|
||||
dprintf("haptic_config.mode = %u\n", haptic_config.mode);
|
||||
}
|
||||
|
||||
void haptic_set_amplitude(uint8_t amp) {
|
||||
haptic_config.amplitude = amp;
|
||||
eeconfig_update_haptic(haptic_config.raw);
|
||||
eeconfig_update_haptic(&haptic_config);
|
||||
dprintf("haptic_config.amplitude = %u\n", haptic_config.amplitude);
|
||||
#ifdef HAPTIC_DRV2605L
|
||||
drv2605l_amplitude(amp);
|
||||
@@ -253,13 +253,13 @@ void haptic_set_amplitude(uint8_t amp) {
|
||||
|
||||
void haptic_set_buzz(uint8_t buzz) {
|
||||
haptic_config.buzz = buzz;
|
||||
eeconfig_update_haptic(haptic_config.raw);
|
||||
eeconfig_update_haptic(&haptic_config);
|
||||
dprintf("haptic_config.buzz = %u\n", haptic_config.buzz);
|
||||
}
|
||||
|
||||
void haptic_set_dwell(uint8_t dwell) {
|
||||
haptic_config.dwell = dwell;
|
||||
eeconfig_update_haptic(haptic_config.raw);
|
||||
eeconfig_update_haptic(&haptic_config);
|
||||
dprintf("haptic_config.dwell = %u\n", haptic_config.dwell);
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ uint8_t haptic_get_dwell(void) {
|
||||
void haptic_enable_continuous(void) {
|
||||
haptic_config.cont = 1;
|
||||
dprintf("haptic_config.cont = %u\n", haptic_config.cont);
|
||||
eeconfig_update_haptic(haptic_config.raw);
|
||||
eeconfig_update_haptic(&haptic_config);
|
||||
#ifdef HAPTIC_DRV2605L
|
||||
drv2605l_rtp_init();
|
||||
#endif
|
||||
@@ -300,7 +300,7 @@ void haptic_enable_continuous(void) {
|
||||
void haptic_disable_continuous(void) {
|
||||
haptic_config.cont = 0;
|
||||
dprintf("haptic_config.cont = %u\n", haptic_config.cont);
|
||||
eeconfig_update_haptic(haptic_config.raw);
|
||||
eeconfig_update_haptic(&haptic_config);
|
||||
#ifdef HAPTIC_DRV2605L
|
||||
drv2605l_write(DRV2605L_REG_MODE, 0x00);
|
||||
#endif
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "compiler_support.h"
|
||||
|
||||
#ifndef HAPTIC_DEFAULT_FEEDBACK
|
||||
# define HAPTIC_DEFAULT_FEEDBACK 0
|
||||
#endif
|
||||
@@ -28,7 +30,7 @@
|
||||
#endif
|
||||
|
||||
/* EEPROM config settings */
|
||||
typedef union {
|
||||
typedef union haptic_config_t {
|
||||
uint32_t raw;
|
||||
struct {
|
||||
bool enable : 1;
|
||||
@@ -42,7 +44,7 @@ typedef union {
|
||||
};
|
||||
} haptic_config_t;
|
||||
|
||||
_Static_assert(sizeof(haptic_config_t) == sizeof(uint32_t), "Haptic EECONFIG out of spec.");
|
||||
STATIC_ASSERT(sizeof(haptic_config_t) == sizeof(uint32_t), "Haptic EECONFIG out of spec.");
|
||||
|
||||
typedef enum HAPTIC_FEEDBACK {
|
||||
KEY_PRESS,
|
||||
|
||||
@@ -122,6 +122,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#ifdef SPLIT_KEYBOARD
|
||||
# include "split_util.h"
|
||||
#endif
|
||||
#ifdef BATTERY_DRIVER
|
||||
# include "battery.h"
|
||||
#endif
|
||||
#ifdef BLUETOOTH_ENABLE
|
||||
# include "bluetooth.h"
|
||||
#endif
|
||||
@@ -143,6 +146,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#ifdef LAYER_LOCK_ENABLE
|
||||
# include "layer_lock.h"
|
||||
#endif
|
||||
#ifdef CONNECTION_ENABLE
|
||||
# include "connection.h"
|
||||
#endif
|
||||
|
||||
static uint32_t last_input_modification_time = 0;
|
||||
uint32_t last_input_activity_time(void) {
|
||||
@@ -429,8 +435,8 @@ void quantum_init(void) {
|
||||
}
|
||||
|
||||
/* init globals */
|
||||
debug_config.raw = eeconfig_read_debug();
|
||||
keymap_config.raw = eeconfig_read_keymap();
|
||||
eeconfig_read_debug(&debug_config);
|
||||
eeconfig_read_keymap(&keymap_config);
|
||||
|
||||
#ifdef BOOTMAGIC_ENABLE
|
||||
bootmagic();
|
||||
@@ -462,6 +468,9 @@ void keyboard_init(void) {
|
||||
#endif
|
||||
matrix_init();
|
||||
quantum_init();
|
||||
#ifdef CONNECTION_ENABLE
|
||||
connection_init();
|
||||
#endif
|
||||
led_init_ports();
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
backlight_init_ports();
|
||||
@@ -500,8 +509,9 @@ void keyboard_init(void) {
|
||||
steno_init();
|
||||
#endif
|
||||
#if defined(NKRO_ENABLE) && defined(FORCE_NKRO)
|
||||
# pragma message "FORCE_NKRO option is now deprecated - Please migrate to NKRO_DEFAULT_ON instead."
|
||||
keymap_config.nkro = 1;
|
||||
eeconfig_update_keymap(keymap_config.raw);
|
||||
eeconfig_update_keymap(&keymap_config);
|
||||
#endif
|
||||
#ifdef DIP_SWITCH_ENABLE
|
||||
dip_switch_init();
|
||||
@@ -522,6 +532,9 @@ void keyboard_init(void) {
|
||||
// init after split init
|
||||
pointing_device_init();
|
||||
#endif
|
||||
#ifdef BATTERY_DRIVER
|
||||
battery_init();
|
||||
#endif
|
||||
#ifdef BLUETOOTH_ENABLE
|
||||
bluetooth_init();
|
||||
#endif
|
||||
@@ -782,6 +795,10 @@ void keyboard_task(void) {
|
||||
joystick_task();
|
||||
#endif
|
||||
|
||||
#ifdef BATTERY_DRIVER
|
||||
battery_task();
|
||||
#endif
|
||||
|
||||
#ifdef BLUETOOTH_ENABLE
|
||||
bluetooth_task();
|
||||
#endif
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define _Static_assert static_assert
|
||||
#endif
|
||||
#include "compiler_support.h"
|
||||
|
||||
#include "eeconfig.h"
|
||||
#include "keycode.h"
|
||||
@@ -28,7 +26,7 @@ uint16_t keycode_config(uint16_t keycode);
|
||||
uint8_t mod_config(uint8_t mod);
|
||||
|
||||
/* NOTE: Not portable. Bit field order depends on implementation */
|
||||
typedef union {
|
||||
typedef union keymap_config_t {
|
||||
uint16_t raw;
|
||||
struct {
|
||||
bool swap_control_capslock : 1;
|
||||
@@ -47,6 +45,6 @@ typedef union {
|
||||
};
|
||||
} keymap_config_t;
|
||||
|
||||
_Static_assert(sizeof(keymap_config_t) == sizeof(uint16_t), "Keycode (magic) EECONFIG out of spec.");
|
||||
STATIC_ASSERT(sizeof(keymap_config_t) == sizeof(uint16_t), "Keycode (magic) EECONFIG out of spec.");
|
||||
|
||||
extern keymap_config_t keymap_config;
|
||||
|
||||
564
quantum/keycode_string.c
Normal file
564
quantum/keycode_string.c
Normal file
@@ -0,0 +1,564 @@
|
||||
// Copyright 2024-2025 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "keycode_string.h"
|
||||
|
||||
#include <string.h>
|
||||
#include "bitwise.h"
|
||||
#include "keycode.h"
|
||||
#include "progmem.h"
|
||||
#include "quantum_keycodes.h"
|
||||
#include "util.h"
|
||||
|
||||
typedef int_fast8_t index_t;
|
||||
|
||||
// clang-format off
|
||||
/** Packs a 7-char keycode name, ignoring the third char, as 3 words. */
|
||||
#define KEYCODE_NAME7(c0, c1, unused_c2, c3, c4, c5, c6) \
|
||||
((uint16_t)c0) | (((uint16_t)c1) << 8), \
|
||||
((uint16_t)c3) | (((uint16_t)c4) << 8), \
|
||||
((uint16_t)c5) | (((uint16_t)c6) << 8)
|
||||
|
||||
/**
|
||||
* @brief Names of some common keycodes.
|
||||
*
|
||||
* Each (keycode, name) entry is stored flat in 8 bytes in PROGMEM. Names in
|
||||
* this table must be at most 7 chars long and have an underscore '_' for the
|
||||
* third char. This underscore is assumed and not actually stored.
|
||||
*
|
||||
* To save memory, feature-specific key entries are ifdef'd to include them only
|
||||
* when their feature is enabled.
|
||||
*/
|
||||
static const uint16_t common_names[] PROGMEM = {
|
||||
KC_TRNS, KEYCODE_NAME7('K', 'C', '_', 'T', 'R', 'N', 'S'),
|
||||
KC_ENT , KEYCODE_NAME7('K', 'C', '_', 'E', 'N', 'T', 0 ),
|
||||
KC_ESC , KEYCODE_NAME7('K', 'C', '_', 'E', 'S', 'C', 0 ),
|
||||
KC_BSPC, KEYCODE_NAME7('K', 'C', '_', 'B', 'S', 'P', 'C'),
|
||||
KC_TAB , KEYCODE_NAME7('K', 'C', '_', 'T', 'A', 'B', 0 ),
|
||||
KC_SPC , KEYCODE_NAME7('K', 'C', '_', 'S', 'P', 'C', 0 ),
|
||||
KC_MINS, KEYCODE_NAME7('K', 'C', '_', 'M', 'I', 'N', 'S'),
|
||||
KC_EQL , KEYCODE_NAME7('K', 'C', '_', 'E', 'Q', 'L', 0 ),
|
||||
KC_LBRC, KEYCODE_NAME7('K', 'C', '_', 'L', 'B', 'R', 'C'),
|
||||
KC_RBRC, KEYCODE_NAME7('K', 'C', '_', 'R', 'B', 'R', 'C'),
|
||||
KC_BSLS, KEYCODE_NAME7('K', 'C', '_', 'B', 'S', 'L', 'S'),
|
||||
KC_NUHS, KEYCODE_NAME7('K', 'C', '_', 'N', 'U', 'H', 'S'),
|
||||
KC_SCLN, KEYCODE_NAME7('K', 'C', '_', 'S', 'C', 'L', 'N'),
|
||||
KC_QUOT, KEYCODE_NAME7('K', 'C', '_', 'Q', 'U', 'O', 'T'),
|
||||
KC_GRV , KEYCODE_NAME7('K', 'C', '_', 'G', 'R', 'V', 0 ),
|
||||
KC_COMM, KEYCODE_NAME7('K', 'C', '_', 'C', 'O', 'M', 'M'),
|
||||
KC_DOT , KEYCODE_NAME7('K', 'C', '_', 'D', 'O', 'T', 0 ),
|
||||
KC_SLSH, KEYCODE_NAME7('K', 'C', '_', 'S', 'L', 'S', 'H'),
|
||||
KC_CAPS, KEYCODE_NAME7('K', 'C', '_', 'C', 'A', 'P', 'S'),
|
||||
KC_PSCR, KEYCODE_NAME7('K', 'C', '_', 'P', 'S', 'C', 'R'),
|
||||
KC_PAUS, KEYCODE_NAME7('K', 'C', '_', 'P', 'A', 'U', 'S'),
|
||||
KC_INS , KEYCODE_NAME7('K', 'C', '_', 'I', 'N', 'S', 0 ),
|
||||
KC_HOME, KEYCODE_NAME7('K', 'C', '_', 'H', 'O', 'M', 'E'),
|
||||
KC_PGUP, KEYCODE_NAME7('K', 'C', '_', 'P', 'G', 'U', 'P'),
|
||||
KC_DEL , KEYCODE_NAME7('K', 'C', '_', 'D', 'E', 'L', 0 ),
|
||||
KC_END , KEYCODE_NAME7('K', 'C', '_', 'E', 'N', 'D', 0 ),
|
||||
KC_PGDN, KEYCODE_NAME7('K', 'C', '_', 'P', 'G', 'D', 'N'),
|
||||
KC_RGHT, KEYCODE_NAME7('K', 'C', '_', 'R', 'G', 'H', 'T'),
|
||||
KC_LEFT, KEYCODE_NAME7('K', 'C', '_', 'L', 'E', 'F', 'T'),
|
||||
KC_DOWN, KEYCODE_NAME7('K', 'C', '_', 'D', 'O', 'W', 'N'),
|
||||
KC_UP , KEYCODE_NAME7('K', 'C', '_', 'U', 'P', 0 , 0 ),
|
||||
KC_NUBS, KEYCODE_NAME7('K', 'C', '_', 'N', 'U', 'B', 'S'),
|
||||
KC_HYPR, KEYCODE_NAME7('K', 'C', '_', 'H', 'Y', 'P', 'R'),
|
||||
KC_MEH , KEYCODE_NAME7('K', 'C', '_', 'M', 'E', 'H', 0 ),
|
||||
#ifdef EXTRAKEY_ENABLE
|
||||
KC_WHOM, KEYCODE_NAME7('K', 'C', '_', 'W', 'H', 'O', 'M'),
|
||||
KC_WBAK, KEYCODE_NAME7('K', 'C', '_', 'W', 'B', 'A', 'K'),
|
||||
KC_WFWD, KEYCODE_NAME7('K', 'C', '_', 'W', 'F', 'W', 'D'),
|
||||
KC_WSTP, KEYCODE_NAME7('K', 'C', '_', 'W', 'S', 'T', 'P'),
|
||||
KC_WREF, KEYCODE_NAME7('K', 'C', '_', 'W', 'R', 'E', 'F'),
|
||||
KC_MNXT, KEYCODE_NAME7('K', 'C', '_', 'M', 'N', 'X', 'T'),
|
||||
KC_MPRV, KEYCODE_NAME7('K', 'C', '_', 'M', 'P', 'R', 'V'),
|
||||
KC_MPLY, KEYCODE_NAME7('K', 'C', '_', 'M', 'P', 'L', 'Y'),
|
||||
KC_MUTE, KEYCODE_NAME7('K', 'C', '_', 'M', 'U', 'T', 'E'),
|
||||
KC_VOLU, KEYCODE_NAME7('K', 'C', '_', 'V', 'O', 'L', 'U'),
|
||||
KC_VOLD, KEYCODE_NAME7('K', 'C', '_', 'V', 'O', 'L', 'D'),
|
||||
#endif // EXTRAKEY_ENABLE
|
||||
#ifdef MOUSEKEY_ENABLE
|
||||
MS_LEFT, KEYCODE_NAME7('M', 'S', '_', 'L', 'E', 'F', 'T'),
|
||||
MS_RGHT, KEYCODE_NAME7('M', 'S', '_', 'R', 'G', 'H', 'T'),
|
||||
MS_UP , KEYCODE_NAME7('M', 'S', '_', 'U', 'P', 0 , 0 ),
|
||||
MS_DOWN, KEYCODE_NAME7('M', 'S', '_', 'D', 'O', 'W', 'N'),
|
||||
MS_WHLL, KEYCODE_NAME7('M', 'S', '_', 'W', 'H', 'L', 'L'),
|
||||
MS_WHLR, KEYCODE_NAME7('M', 'S', '_', 'W', 'H', 'L', 'R'),
|
||||
MS_WHLU, KEYCODE_NAME7('M', 'S', '_', 'W', 'H', 'L', 'U'),
|
||||
MS_WHLD, KEYCODE_NAME7('M', 'S', '_', 'W', 'H', 'L', 'D'),
|
||||
#endif // MOUSEKEY_ENABLE
|
||||
#ifdef SWAP_HANDS_ENABLE
|
||||
SH_ON , KEYCODE_NAME7('S', 'H', '_', 'O', 'N', 0 , 0 ),
|
||||
SH_OFF , KEYCODE_NAME7('S', 'H', '_', 'O', 'F', 'F', 0 ),
|
||||
SH_MON , KEYCODE_NAME7('S', 'H', '_', 'M', 'O', 'N', 0 ),
|
||||
SH_MOFF, KEYCODE_NAME7('S', 'H', '_', 'M', 'O', 'F', 'F'),
|
||||
SH_TOGG, KEYCODE_NAME7('S', 'H', '_', 'T', 'O', 'G', 'G'),
|
||||
SH_TT , KEYCODE_NAME7('S', 'H', '_', 'T', 'T', 0 , 0 ),
|
||||
# if !defined(NO_ACTION_ONESHOT)
|
||||
SH_OS , KEYCODE_NAME7('S', 'H', '_', 'O', 'S', 0 , 0 ),
|
||||
# endif // !defined(NO_ACTION_ONESHOT)
|
||||
#endif // SWAP_HANDS_ENABLE
|
||||
#ifdef LEADER_ENABLE
|
||||
QK_LEAD, KEYCODE_NAME7('Q', 'K', '_', 'L', 'E', 'A', 'D'),
|
||||
#endif // LEADER_ENABLE
|
||||
#ifdef KEY_LOCK_ENABLE
|
||||
QK_LOCK, KEYCODE_NAME7('Q', 'K', '_', 'L', 'O', 'C', 'K'),
|
||||
#endif // KEY_LOCK_ENABLE
|
||||
#ifdef TRI_LAYER_ENABLE
|
||||
TL_LOWR, KEYCODE_NAME7('T', 'L', '_', 'L', 'O', 'W', 'R'),
|
||||
TL_UPPR, KEYCODE_NAME7('T', 'L', '_', 'U', 'P', 'P', 'R'),
|
||||
#endif // TRI_LAYER_ENABLE
|
||||
#ifdef GRAVE_ESC_ENABLE
|
||||
QK_GESC, KEYCODE_NAME7('Q', 'K', '_', 'G', 'E', 'S', 'C'),
|
||||
#endif // GRAVE_ESC_ENABLE
|
||||
#ifdef CAPS_WORD_ENABLE
|
||||
CW_TOGG, KEYCODE_NAME7('C', 'W', '_', 'T', 'O', 'G', 'G'),
|
||||
#endif // CAPS_WORD_ENABLE
|
||||
#ifdef SECURE_ENABLE
|
||||
SE_LOCK, KEYCODE_NAME7('S', 'E', '_', 'L', 'O', 'C', 'K'),
|
||||
SE_UNLK, KEYCODE_NAME7('S', 'E', '_', 'U', 'N', 'L', 'K'),
|
||||
SE_TOGG, KEYCODE_NAME7('S', 'E', '_', 'T', 'O', 'G', 'G'),
|
||||
SE_REQ , KEYCODE_NAME7('S', 'E', '_', 'R', 'E', 'Q', 0 ),
|
||||
#endif // SECURE_ENABLE
|
||||
#ifdef LAYER_LOCK_ENABLE
|
||||
QK_LLCK, KEYCODE_NAME7('Q', 'K', '_', 'L', 'L', 'C', 'K'),
|
||||
#endif // LAYER_LOCK_ENABLE
|
||||
EE_CLR , KEYCODE_NAME7('E', 'E', '_', 'C', 'L', 'R', 0 ),
|
||||
QK_BOOT, KEYCODE_NAME7('Q', 'K', '_', 'B', 'O', 'O', 'T'),
|
||||
DB_TOGG, KEYCODE_NAME7('D', 'B', '_', 'T', 'O', 'G', 'G'),
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
/** Users can override this to define names of additional keycodes. */
|
||||
__attribute__((weak)) const keycode_string_name_t* keycode_string_names_data_user = NULL;
|
||||
__attribute__((weak)) uint16_t keycode_string_names_size_user = 0;
|
||||
/** Keyboard vendors can override this to define names of additional keycodes. */
|
||||
__attribute__((weak)) const keycode_string_name_t* keycode_string_names_data_kb = NULL;
|
||||
__attribute__((weak)) uint16_t keycode_string_names_size_kb = 0;
|
||||
/** Names of the 4 mods on each hand. */
|
||||
static const char mod_names[] PROGMEM = "CTL\0SFT\0ALT\0GUI";
|
||||
/** Internal buffer for holding a stringified keycode. */
|
||||
static char buffer[32];
|
||||
#define BUFFER_MAX_LEN (sizeof(buffer) - 1)
|
||||
static index_t buffer_len;
|
||||
|
||||
/** Finds the name of a keycode in `common_names` or returns NULL. */
|
||||
static const char* search_common_names(uint16_t keycode) {
|
||||
static uint8_t buffer[8];
|
||||
|
||||
for (int_fast16_t offset = 0; offset < ARRAY_SIZE(common_names); offset += 4) {
|
||||
if (keycode == pgm_read_word(common_names + offset)) {
|
||||
const uint16_t w0 = pgm_read_word(common_names + offset + 1);
|
||||
const uint16_t w1 = pgm_read_word(common_names + offset + 2);
|
||||
const uint16_t w2 = pgm_read_word(common_names + offset + 3);
|
||||
buffer[0] = (uint8_t)w0;
|
||||
buffer[1] = (uint8_t)(w0 >> 8);
|
||||
buffer[2] = '_';
|
||||
buffer[3] = (uint8_t)w1;
|
||||
buffer[4] = (uint8_t)(w1 >> 8);
|
||||
buffer[5] = (uint8_t)w2;
|
||||
buffer[6] = (uint8_t)(w2 >> 8);
|
||||
buffer[7] = 0;
|
||||
return (const char*)buffer;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Finds the name of a keycode in table or returns NULL.
|
||||
*
|
||||
* @param data Pointer to table to be searched.
|
||||
* @param size Numer of entries in the table.
|
||||
* @return Name string for the keycode, or NULL if not found.
|
||||
*/
|
||||
static const char* search_table(const keycode_string_name_t* data, uint16_t size, uint16_t keycode) {
|
||||
if (data != NULL) {
|
||||
for (uint16_t i = 0; i < size; ++i) {
|
||||
if (data[i].keycode == keycode) {
|
||||
return data[i].name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/** Formats `number` in `base`, either 10 or 16. */
|
||||
static char* number_string(uint16_t number, int8_t base) {
|
||||
static char result[7];
|
||||
result[sizeof(result) - 1] = '\0';
|
||||
index_t i = sizeof(result) - 1;
|
||||
do {
|
||||
const uint8_t digit = number % base;
|
||||
number /= base;
|
||||
result[--i] = (digit < 10) ? (char)(digit + UINT8_C('0')) : (char)(digit + (UINT8_C('A') - 10));
|
||||
} while (number > 0 && i > 0);
|
||||
|
||||
if (base == 16 && i >= 2) {
|
||||
result[--i] = 'x';
|
||||
result[--i] = '0';
|
||||
}
|
||||
return result + i;
|
||||
}
|
||||
|
||||
/** Appends `str` to `buffer`, truncating if the result would overflow. */
|
||||
static void append(const char* str) {
|
||||
char* dest = buffer + buffer_len;
|
||||
index_t i;
|
||||
for (i = 0; buffer_len + i < BUFFER_MAX_LEN && str[i]; ++i) {
|
||||
dest[i] = str[i];
|
||||
}
|
||||
buffer_len += i;
|
||||
buffer[buffer_len] = '\0';
|
||||
}
|
||||
|
||||
/** Same as append(), but where `str` is a PROGMEM string. */
|
||||
static void append_P(const char* str) {
|
||||
char* dest = buffer + buffer_len;
|
||||
index_t i;
|
||||
for (i = 0; buffer_len + i < BUFFER_MAX_LEN; ++i) {
|
||||
const char c = pgm_read_byte(&str[i]);
|
||||
if (c == '\0') {
|
||||
break;
|
||||
}
|
||||
dest[i] = c;
|
||||
}
|
||||
buffer_len += i;
|
||||
buffer[buffer_len] = '\0';
|
||||
}
|
||||
|
||||
/** Appends a single char to `buffer` if there is space. */
|
||||
static void append_char(char c) {
|
||||
if (buffer_len < BUFFER_MAX_LEN) {
|
||||
buffer[buffer_len] = c;
|
||||
buffer[++buffer_len] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
/** Formats `number` in `base`, either 10 or 16, and appends it to `buffer`. */
|
||||
static void append_number(uint16_t number, int8_t base) {
|
||||
append(number_string(number, base));
|
||||
}
|
||||
|
||||
/** Stringifies 5-bit mods and appends it to `buffer`. */
|
||||
static void append_5_bit_mods(uint8_t mods) {
|
||||
const bool is_rhs = mods > 15;
|
||||
const uint8_t csag = mods & 15;
|
||||
if (csag != 0 && (csag & (csag - 1)) == 0) { // One mod is set.
|
||||
append_P(PSTR("MOD_"));
|
||||
append_char(is_rhs ? 'R' : 'L');
|
||||
append_P(&mod_names[4 * biton(csag)]);
|
||||
} else { // Fallback: write the mod as a hex value.
|
||||
append_number(mods, 16);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Writes a keycode of the format `name` + "(" + `param` + ")".
|
||||
* @note `name` is a PROGMEM string, `param` is not.
|
||||
*/
|
||||
static void append_unary_keycode(const char* name, const char* param) {
|
||||
append_P(name);
|
||||
append_char('(');
|
||||
append(param);
|
||||
append_char(')');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Writes a keycode of the format `name` + `number`.
|
||||
* @note `name` is a PROGMEM string.
|
||||
*/
|
||||
static void append_numbered_keycode(const char* name, uint16_t number) {
|
||||
append_P(name);
|
||||
append_number(number, 10);
|
||||
}
|
||||
|
||||
/** Stringifies `keycode` and appends it to `buffer`. */
|
||||
static void append_keycode(uint16_t keycode) {
|
||||
// In case there is overlap among tables, search `keycode_string_names_user`
|
||||
// first so that it takes precedence.
|
||||
const char* keycode_name = search_table(keycode_string_names_data_user, keycode_string_names_size_user, keycode);
|
||||
if (keycode_name) {
|
||||
append(keycode_name);
|
||||
return;
|
||||
}
|
||||
keycode_name = search_table(keycode_string_names_data_kb, keycode_string_names_size_kb, keycode);
|
||||
if (keycode_name) {
|
||||
append(keycode_name);
|
||||
return;
|
||||
}
|
||||
keycode_name = search_common_names(keycode);
|
||||
if (keycode_name) {
|
||||
append(keycode_name);
|
||||
return;
|
||||
}
|
||||
|
||||
if (keycode <= 255) { // Basic keycodes.
|
||||
switch (keycode) {
|
||||
// Modifiers KC_LSFT, KC_RCTL, etc.
|
||||
case MODIFIER_KEYCODE_RANGE: {
|
||||
const uint8_t i = keycode - KC_LCTL;
|
||||
const bool is_rhs = i > 3;
|
||||
append_P(PSTR("KC_"));
|
||||
append_char(is_rhs ? 'R' : 'L');
|
||||
append_P(&mod_names[4 * (i & 3)]);
|
||||
}
|
||||
return;
|
||||
|
||||
// Letters A-Z.
|
||||
case KC_A ... KC_Z:
|
||||
append_P(PSTR("KC_"));
|
||||
append_char((char)(keycode + (UINT8_C('A') - KC_A)));
|
||||
return;
|
||||
|
||||
// Digits 0-9 (NOTE: Unlike the ASCII order, KC_0 comes *after* KC_9.)
|
||||
case KC_1 ... KC_0:
|
||||
append_numbered_keycode(PSTR("KC_"), (keycode - (KC_1 - 1)) % 10);
|
||||
return;
|
||||
|
||||
// Keypad digits.
|
||||
case KC_KP_1 ... KC_KP_0:
|
||||
append_numbered_keycode(PSTR("KC_KP_"), (keycode - (KC_KP_1 - 1)) % 10);
|
||||
return;
|
||||
|
||||
// Function keys. F1-F12 and F13-F24 are coded in separate ranges.
|
||||
case KC_F1 ... KC_F12:
|
||||
append_numbered_keycode(PSTR("KC_F"), keycode - (KC_F1 - 1));
|
||||
return;
|
||||
|
||||
case KC_F13 ... KC_F24:
|
||||
append_numbered_keycode(PSTR("KC_F"), keycode - (KC_F13 - 13));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
switch (keycode) {
|
||||
// A modified keycode, like S(KC_1) for Shift + 1 = !. This implementation
|
||||
// only covers modified keycodes where one modifier is applied, e.g. a
|
||||
// Ctrl + Shift + kc or Hyper + kc keycode is not formatted.
|
||||
case QK_MODS ... QK_MODS_MAX: {
|
||||
uint8_t mods = QK_MODS_GET_MODS(keycode);
|
||||
const bool is_rhs = mods > 15;
|
||||
mods &= 15;
|
||||
if (mods != 0 && (mods & (mods - 1)) == 0) { // One mod is set.
|
||||
const char* name = &mod_names[4 * biton(mods)];
|
||||
if (is_rhs) {
|
||||
append_char('R');
|
||||
append_P(name);
|
||||
} else {
|
||||
append_char(pgm_read_byte(&name[0]));
|
||||
}
|
||||
append_char('(');
|
||||
append_keycode(QK_MODS_GET_BASIC_KEYCODE(keycode));
|
||||
append_char(')');
|
||||
return;
|
||||
}
|
||||
} break;
|
||||
|
||||
#if !defined(NO_ACTION_ONESHOT)
|
||||
case QK_ONE_SHOT_MOD ... QK_ONE_SHOT_MOD_MAX: // One-shot mod OSM(mod) key.
|
||||
append_P(PSTR("OSM("));
|
||||
append_5_bit_mods(QK_ONE_SHOT_MOD_GET_MODS(keycode));
|
||||
append_char(')');
|
||||
return;
|
||||
#endif // !defined(NO_ACTION_ONESHOT)
|
||||
|
||||
// Various layer switch keys.
|
||||
case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: // Layer-tap LT(layer,kc) key.
|
||||
append_P(PSTR("LT("));
|
||||
append_number(QK_LAYER_TAP_GET_LAYER(keycode), 10);
|
||||
append_char(',');
|
||||
append_keycode(QK_LAYER_TAP_GET_TAP_KEYCODE(keycode));
|
||||
append_char(')');
|
||||
return;
|
||||
|
||||
case QK_LAYER_MOD ... QK_LAYER_MOD_MAX: // LM(layer,mod) key.
|
||||
append_P(PSTR("LM("));
|
||||
append_number(QK_LAYER_MOD_GET_LAYER(keycode), 10);
|
||||
append_char(',');
|
||||
append_5_bit_mods(QK_LAYER_MOD_GET_MODS(keycode));
|
||||
append_char(')');
|
||||
return;
|
||||
|
||||
case QK_TO ... QK_TO_MAX: // TO(layer) key.
|
||||
append_unary_keycode(PSTR("TO"), number_string(QK_TO_GET_LAYER(keycode), 10));
|
||||
return;
|
||||
|
||||
case QK_MOMENTARY ... QK_MOMENTARY_MAX: // MO(layer) key.
|
||||
append_unary_keycode(PSTR("MO"), number_string(QK_MOMENTARY_GET_LAYER(keycode), 10));
|
||||
return;
|
||||
|
||||
case QK_DEF_LAYER ... QK_DEF_LAYER_MAX: // DF(layer) key.
|
||||
append_unary_keycode(PSTR("DF"), number_string(QK_DEF_LAYER_GET_LAYER(keycode), 10));
|
||||
return;
|
||||
|
||||
case QK_TOGGLE_LAYER ... QK_TOGGLE_LAYER_MAX: // TG(layer) key.
|
||||
append_unary_keycode(PSTR("TG"), number_string(QK_TOGGLE_LAYER_GET_LAYER(keycode), 10));
|
||||
return;
|
||||
|
||||
#if !defined(NO_ACTION_ONESHOT)
|
||||
case QK_ONE_SHOT_LAYER ... QK_ONE_SHOT_LAYER_MAX: // OSL(layer) key.
|
||||
append_unary_keycode(PSTR("OSL"), number_string(QK_ONE_SHOT_LAYER_GET_LAYER(keycode), 10));
|
||||
return;
|
||||
#endif // !defined(NO_ACTION_ONESHOT)
|
||||
|
||||
case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX: // TT(layer) key.
|
||||
append_unary_keycode(PSTR("TT"), number_string(QK_LAYER_TAP_TOGGLE_GET_LAYER(keycode), 10));
|
||||
return;
|
||||
|
||||
case QK_PERSISTENT_DEF_LAYER ... QK_PERSISTENT_DEF_LAYER_MAX: // PDF(layer) key.
|
||||
append_unary_keycode(PSTR("PDF"), number_string(QK_PERSISTENT_DEF_LAYER_GET_LAYER(keycode), 10));
|
||||
return;
|
||||
|
||||
// Mod-tap MT(mod,kc) key. This implementation formats the MT keys where
|
||||
// one modifier is applied. For MT keys with multiple modifiers, the mod
|
||||
// arg is written numerically as a hex code.
|
||||
case QK_MOD_TAP ... QK_MOD_TAP_MAX: {
|
||||
uint8_t mods = QK_MOD_TAP_GET_MODS(keycode);
|
||||
const bool is_rhs = mods > 15;
|
||||
const uint8_t csag = mods & 15;
|
||||
if (csag != 0 && (csag & (csag - 1)) == 0) { // One mod is set.
|
||||
append_char(is_rhs ? 'R' : 'L');
|
||||
append_P(&mod_names[4 * biton(csag)]);
|
||||
append_P(PSTR("_T("));
|
||||
} else if (mods == MOD_HYPR) {
|
||||
append_P(PSTR("HYPR_T("));
|
||||
} else if (mods == MOD_MEH) {
|
||||
append_P(PSTR("MEH_T("));
|
||||
} else {
|
||||
append_P(PSTR("MT("));
|
||||
append_number(mods, 16);
|
||||
append_char(',');
|
||||
}
|
||||
append_keycode(QK_MOD_TAP_GET_TAP_KEYCODE(keycode));
|
||||
append_char(')');
|
||||
} return;
|
||||
|
||||
case QK_TAP_DANCE ... QK_TAP_DANCE_MAX: // Tap dance TD(i) key.
|
||||
append_unary_keycode(PSTR("TD"), number_string(QK_TAP_DANCE_GET_INDEX(keycode), 10));
|
||||
return;
|
||||
|
||||
#ifdef UNICODE_ENABLE
|
||||
case QK_UNICODE ... QK_UNICODE_MAX: // Unicode UC(codepoint) key.
|
||||
append_unary_keycode(PSTR("UC"), number_string(QK_UNICODE_GET_CODE_POINT(keycode), 16));
|
||||
return;
|
||||
#elif defined(UNICODEMAP_ENABLE)
|
||||
case QK_UNICODEMAP ... QK_UNICODEMAP_MAX: // Unicode Map UM(i) key.
|
||||
append_unary_keycode(PSTR("UM"), number_string(QK_UNICODEMAP_GET_INDEX(keycode), 10));
|
||||
return;
|
||||
|
||||
case QK_UNICODEMAP_PAIR ... QK_UNICODEMAP_PAIR_MAX: { // UP(i,j) key.
|
||||
const uint8_t i = QK_UNICODEMAP_PAIR_GET_UNSHIFTED_INDEX(keycode);
|
||||
const uint8_t j = QK_UNICODEMAP_PAIR_GET_SHIFTED_INDEX(keycode);
|
||||
append_P(PSTR("UP("));
|
||||
append_number(i, 10);
|
||||
append_char(',');
|
||||
append_number(j, 10);
|
||||
append_char(')');
|
||||
} return;
|
||||
#endif
|
||||
#ifdef MOUSEKEY_ENABLE
|
||||
case MS_BTN1 ... MS_BTN8: // Mouse button keycode.
|
||||
append_numbered_keycode(PSTR("MS_BTN"), keycode - (MS_BTN1 - 1));
|
||||
return;
|
||||
#endif // MOUSEKEY_ENABLE
|
||||
#ifdef SWAP_HANDS_ENABLE
|
||||
case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX: // Swap Hands SH_T(kc) key.
|
||||
if (!IS_SWAP_HANDS_KEYCODE(keycode)) {
|
||||
append_P(PSTR("SH_T("));
|
||||
append_keycode(QK_SWAP_HANDS_GET_TAP_KEYCODE(keycode));
|
||||
append_char(')');
|
||||
return;
|
||||
}
|
||||
break;
|
||||
#endif // SWAP_HANDS_ENABLE
|
||||
#ifdef JOYSTICK_ENABLE
|
||||
case JOYSTICK_KEYCODE_RANGE: // Joystick JS_ key.
|
||||
append_numbered_keycode(PSTR("JS_"), keycode - JS_0);
|
||||
return;
|
||||
#endif // JOYSTICK_ENABLE
|
||||
#ifdef PROGRAMMABLE_BUTTON_ENABLE
|
||||
case PROGRAMMABLE_BUTTON_KEYCODE_RANGE: // Programmable button PB_ key.
|
||||
append_numbered_keycode(PSTR("PB_"), keycode - (PB_1 - 1));
|
||||
return;
|
||||
#endif // PROGRAMMABLE_BUTTON_ENABLE
|
||||
|
||||
case MACRO_KEYCODE_RANGE: // Macro range MC_ keycode.
|
||||
append_numbered_keycode(PSTR("MC_"), keycode - MC_0);
|
||||
return;
|
||||
|
||||
case KB_KEYCODE_RANGE: // Keyboard range keycode.
|
||||
append_numbered_keycode(PSTR("QK_KB_"), keycode - QK_KB_0);
|
||||
return;
|
||||
|
||||
case USER_KEYCODE_RANGE: // User range keycode.
|
||||
append_numbered_keycode(PSTR("QK_USER_"), keycode - QK_USER_0);
|
||||
return;
|
||||
|
||||
// It would take a nontrivial amount of string data to cover some
|
||||
// feature-specific keycodes, such as those for MIDI and lighting. As a
|
||||
// fallback while still providing some information, we stringify
|
||||
// remaining keys in known code ranges as "QK_<feature>+<number>".
|
||||
#ifdef MAGIC_ENABLE
|
||||
case MAGIC_KEYCODE_RANGE:
|
||||
append_numbered_keycode(PSTR("QK_MAGIC+"), keycode - QK_MAGIC);
|
||||
return;
|
||||
#endif // MAGIC_ENABLE
|
||||
#ifdef MIDI_ENABLE
|
||||
case MIDI_KEYCODE_RANGE:
|
||||
append_numbered_keycode(PSTR("QK_MIDI+"), keycode - QK_MIDI);
|
||||
return;
|
||||
#endif // MIDI_ENABLE
|
||||
#ifdef SEQUENCER_ENABLE
|
||||
case SEQUENCER_KEYCODE_RANGE:
|
||||
append_numbered_keycode(PSTR("QK_SEQUENCER+"), keycode - QK_SEQUENCER);
|
||||
return;
|
||||
#endif // SEQUENCER_ENABLE
|
||||
#ifdef AUDIO_ENABLE
|
||||
case AUDIO_KEYCODE_RANGE:
|
||||
append_numbered_keycode(PSTR("QK_AUDIO+"), keycode - QK_AUDIO);
|
||||
return;
|
||||
#endif // AUDIO_ENABLE
|
||||
#if defined(BACKLIGHT_ENABLE) || defined(LED_MATRIX_ENABLE) || defined(RGBLIGHT_ENABLED) || defined(RGB_MATRIX_ENABLE) // Lighting-related features.
|
||||
case QK_LIGHTING ... QK_LIGHTING_MAX:
|
||||
append_numbered_keycode(PSTR("QK_LIGHTING+"), keycode - QK_LIGHTING);
|
||||
return;
|
||||
#endif // defined(BACKLIGHT_ENABLE) || defined(LED_MATRIX_ENABLE) || defined(RGBLIGHT_ENABLED) || defined(RGB_MATRIX_ENABLE)
|
||||
#ifdef STENO_ENABLE
|
||||
case STENO_KEYCODE_RANGE:
|
||||
append_numbered_keycode(PSTR("QK_STENO+"), keycode - QK_STENO);
|
||||
return;
|
||||
#endif // AUDIO_ENABLE
|
||||
#ifdef BLUETOOTH_ENABLE
|
||||
case CONNECTION_KEYCODE_RANGE:
|
||||
append_numbered_keycode(PSTR("QK_CONNECTION+"), keycode - QK_CONNECTION);
|
||||
return;
|
||||
#endif // BLUETOOTH_ENABLE
|
||||
case QUANTUM_KEYCODE_RANGE:
|
||||
append_numbered_keycode(PSTR("QK_QUANTUM+"), keycode - QK_QUANTUM);
|
||||
return;
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
append_number(keycode, 16); // Fallback: write keycode as hex value.
|
||||
}
|
||||
|
||||
const char* get_keycode_string(uint16_t keycode) {
|
||||
buffer_len = 0;
|
||||
buffer[0] = '\0';
|
||||
append_keycode(keycode);
|
||||
return buffer;
|
||||
}
|
||||
134
quantum/keycode_string.h
Normal file
134
quantum/keycode_string.h
Normal file
@@ -0,0 +1,134 @@
|
||||
// Copyright 2024-2025 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if KEYCODE_STRING_ENABLE
|
||||
|
||||
/**
|
||||
* @brief Formats a QMK keycode as a human-readable string.
|
||||
*
|
||||
* Given a keycode, like `KC_A`, this function returns a formatted string, like
|
||||
* "KC_A". This is useful for debugging and diagnostics so that keys are more
|
||||
* easily identified than they would be by raw numerical codes.
|
||||
*
|
||||
* @note The returned char* string should be used right away. The string memory
|
||||
* is reused and will be overwritten by the next call to `keycode_string()`.
|
||||
*
|
||||
* Many common QMK keycodes are understood by this function, but not all.
|
||||
* Recognized keycodes include:
|
||||
*
|
||||
* - Most basic keycodes, including letters `KC_A` - `KC_Z`, digits `KC_0` -
|
||||
* `KC_9`, function keys `KC_F1` - `KC_F24`, and modifiers like `KC_LSFT`.
|
||||
*
|
||||
* - Modified basic keycodes, like `S(KC_1)` (Shift + 1 = !).
|
||||
*
|
||||
* - `MO`, `TO`, `TG`, `OSL`, `LM(layer,mod)`, `LT(layer,kc)` layer switches.
|
||||
*
|
||||
* - One-shot mod `OSM(mod)` keycodes.
|
||||
*
|
||||
* - Mod-tap `MT(mod, kc)` keycodes.
|
||||
*
|
||||
* - Tap dance keycodes `TD(i)`.
|
||||
*
|
||||
* - Swap hands keycodes `SH_T(kc)`, `SH_TOGG`, etc.
|
||||
*
|
||||
* - Joystick keycodes `JS_n`.
|
||||
*
|
||||
* - Programmable button keycodes `PB_n`.
|
||||
*
|
||||
* - Unicode `UC(codepoint)` and Unicode Map `UM(i)` and `UP(i,j)` keycodes.
|
||||
*
|
||||
* - Keyboard range keycodes `QK_KB_*`.
|
||||
*
|
||||
* - User range (SAFE_RANGE) keycodes `QK_USER_*`.
|
||||
*
|
||||
* Keycodes involving mods like `OSM`, `LM`, `MT` are fully supported only where
|
||||
* a single mod is applied.
|
||||
*
|
||||
* Unrecognized keycodes are printed numerically as hex values like `0x1ABC`.
|
||||
*
|
||||
* Optionally, use `keycode_string_names_user` or `keycode_string_names_kb` to
|
||||
* define names for additional keycodes or override how any of the above are
|
||||
* formatted.
|
||||
*
|
||||
* @param keycode QMK keycode.
|
||||
* @return Stringified keycode.
|
||||
*/
|
||||
const char* get_keycode_string(uint16_t keycode);
|
||||
|
||||
/** Defines a human-readable name for a keycode. */
|
||||
typedef struct {
|
||||
uint16_t keycode;
|
||||
const char* name;
|
||||
} keycode_string_name_t;
|
||||
|
||||
// clang-format off
|
||||
/**
|
||||
* @brief Defines names for additional keycodes for `get_keycode_string()`.
|
||||
*
|
||||
* Define `KEYCODE_STRING_NAMES_USER` in your keymap.c to add names for
|
||||
* additional keycodes to `keycode_string()`. This table may also be used to
|
||||
* override how `keycode_string()` formats a keycode. For example, supposing
|
||||
* keymap.c defines `MYMACRO1` and `MYMACRO2` as custom keycodes:
|
||||
*
|
||||
* KEYCODE_STRING_NAMES_USER(
|
||||
* KEYCODE_STRING_NAME(MYMACRO1),
|
||||
* KEYCODE_STRING_NAME(MYMACRO2),
|
||||
* KEYCODE_STRING_NAME(KC_EXLM),
|
||||
* );
|
||||
*
|
||||
* The above defines names for `MYMACRO1` and `MYMACRO2`, and overrides
|
||||
* `KC_EXLM` to format as "KC_EXLM" instead of the default "S(KC_1)".
|
||||
*/
|
||||
# define KEYCODE_STRING_NAMES_USER(...) \
|
||||
static const keycode_string_name_t keycode_string_names_user[] = {__VA_ARGS__}; \
|
||||
uint16_t keycode_string_names_size_user = \
|
||||
sizeof(keycode_string_names_user) / sizeof(keycode_string_name_t); \
|
||||
const keycode_string_name_t* keycode_string_names_data_user = \
|
||||
keycode_string_names_user
|
||||
|
||||
/** Same as above, but defines keycode string names at the keyboard level. */
|
||||
# define KEYCODE_STRING_NAMES_KB(...) \
|
||||
static const keycode_string_name_t keycode_string_names_kb[] = {__VA_ARGS__}; \
|
||||
uint16_t keycode_string_names_size_kb = \
|
||||
sizeof(keycode_string_names_kb) / sizeof(keycode_string_name_t); \
|
||||
const keycode_string_name_t* keycode_string_names_data_kb = \
|
||||
keycode_string_names_kb
|
||||
|
||||
/** Helper to define a keycode_string_name_t. */
|
||||
# define KEYCODE_STRING_NAME(kc) \
|
||||
{ (kc), #kc }
|
||||
// clang-format on
|
||||
|
||||
extern const keycode_string_name_t* keycode_string_names_data_user;
|
||||
extern uint16_t keycode_string_names_size_user;
|
||||
extern const keycode_string_name_t* keycode_string_names_data_kb;
|
||||
extern uint16_t keycode_string_names_size_kb;
|
||||
|
||||
#else
|
||||
|
||||
// When keycode_string is disabled, fall back to printing keycodes numerically
|
||||
// as decimal values, using get_u16_str() from quantum.c.
|
||||
# define get_keycode_string(kc) get_u16_str(kc, ' ')
|
||||
|
||||
const char* get_u16_str(uint16_t curr_num, char curr_pad);
|
||||
|
||||
# define KEYCODE_STRING_NAMES_USER(...)
|
||||
# define KEYCODE_STRING_NAMES_KB(...)
|
||||
# define KEYCODE_STRING_NAME(kc)
|
||||
|
||||
#endif // KEYCODE_STRING_ENABLE
|
||||
@@ -26,6 +26,12 @@
|
||||
#pragma once
|
||||
// clang-format off
|
||||
|
||||
#define QMK_KEYCODES_VERSION "0.0.7"
|
||||
#define QMK_KEYCODES_VERSION_BCD 0x00000007
|
||||
#define QMK_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_KEYCODES_VERSION_PATCH 7
|
||||
|
||||
enum qk_keycode_ranges {
|
||||
// Ranges
|
||||
QK_BASIC = 0x0000,
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_BELGIAN_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_BELGIAN_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_BELGIAN_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_BELGIAN_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_BELGIAN_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define BE_SUP2 KC_GRV // ²
|
||||
#define BE_AMPR KC_1 // &
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_BEPO_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_BEPO_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_BEPO_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_BEPO_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_BEPO_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define BP_DLR KC_GRV // $
|
||||
#define BP_DQUO KC_1 // "
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_BRAZILIAN_ABNT2_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_BRAZILIAN_ABNT2_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_BRAZILIAN_ABNT2_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_BRAZILIAN_ABNT2_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_BRAZILIAN_ABNT2_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define BR_QUOT KC_GRV // '
|
||||
#define BR_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_CANADIAN_FRENCH_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_CANADIAN_FRENCH_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_CANADIAN_FRENCH_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_CANADIAN_FRENCH_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_CANADIAN_FRENCH_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define FR_HASH KC_GRV // #
|
||||
#define FR_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_CANADIAN_MULTILINGUAL_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_CANADIAN_MULTILINGUAL_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_CANADIAN_MULTILINGUAL_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_CANADIAN_MULTILINGUAL_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_CANADIAN_MULTILINGUAL_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define CA_SLSH KC_GRV // /
|
||||
#define CA_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_COLEMAK_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_COLEMAK_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_COLEMAK_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_COLEMAK_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_COLEMAK_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define CM_GRV KC_GRV // `
|
||||
#define CM_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_CROATIAN_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_CROATIAN_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_CROATIAN_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_CROATIAN_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_CROATIAN_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define HR_CEDL KC_GRV // ¸ (dead)
|
||||
#define HR_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_CZECH_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_CZECH_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_CZECH_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_CZECH_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_CZECH_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define CZ_SCLN KC_GRV // ;
|
||||
#define CZ_PLUS KC_1 // +
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_CZECH_MAC_ANSI_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_CZECH_MAC_ANSI_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_CZECH_MAC_ANSI_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_CZECH_MAC_ANSI_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_CZECH_MAC_ANSI_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define CZ_BSLS KC_GRV // (backslash)
|
||||
#define CZ_PLUS KC_1 // +
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_CZECH_MAC_ISO_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_CZECH_MAC_ISO_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_CZECH_MAC_ISO_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_CZECH_MAC_ISO_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_CZECH_MAC_ISO_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define CZ_PLUS KC_1 // +
|
||||
#define CZ_ECAR KC_2 // ě
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_DANISH_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_DANISH_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_DANISH_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_DANISH_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_DANISH_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define DK_HALF KC_GRV // ½
|
||||
#define DK_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_DVORAK_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_DVORAK_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_DVORAK_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_DVORAK_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_DVORAK_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define DV_GRV KC_GRV // `
|
||||
#define DV_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_DVORAK_FR_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_DVORAK_FR_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_DVORAK_FR_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_DVORAK_FR_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_DVORAK_FR_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define DV_LDAQ KC_GRV // «
|
||||
#define DV_RDAQ KC_1 // »
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_DVORAK_PROGRAMMER_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_DVORAK_PROGRAMMER_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_DVORAK_PROGRAMMER_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_DVORAK_PROGRAMMER_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_DVORAK_PROGRAMMER_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define DP_DLR KC_GRV // $
|
||||
#define DP_AMPR KC_1 // &
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_ESTONIAN_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_ESTONIAN_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_ESTONIAN_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_ESTONIAN_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_ESTONIAN_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define EE_CARN KC_GRV // ˇ (dead)
|
||||
#define EE_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_EURKEY_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_EURKEY_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_EURKEY_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_EURKEY_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_EURKEY_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define EU_GRV KC_GRV // `
|
||||
#define EU_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_FARSI_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_FARSI_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_FARSI_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_FARSI_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_FARSI_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define FA_ZWJ KC_GRV // (zero-width joiner)
|
||||
#define FA_1A KC_1 // ۱
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_FINNISH_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_FINNISH_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_FINNISH_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_FINNISH_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_FINNISH_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define FI_SECT KC_GRV // §
|
||||
#define FI_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_FRENCH_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_FRENCH_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_FRENCH_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_FRENCH_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_FRENCH_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define FR_SUP2 KC_GRV // ²
|
||||
#define FR_AMPR KC_1 // &
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_FRENCH_AFNOR_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_FRENCH_AFNOR_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_FRENCH_AFNOR_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_FRENCH_AFNOR_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_FRENCH_AFNOR_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define FR_AT KC_GRV // @
|
||||
#define FR_AGRV KC_1 // à
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_FRENCH_MAC_ISO_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_FRENCH_MAC_ISO_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_FRENCH_MAC_ISO_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_FRENCH_MAC_ISO_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_FRENCH_MAC_ISO_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define FR_AT KC_GRV // @
|
||||
#define FR_AMPR KC_1 // &
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_GERMAN_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_GERMAN_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_GERMAN_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_GERMAN_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_GERMAN_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define DE_CIRC KC_GRV // ^ (dead)
|
||||
#define DE_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_GERMAN_MAC_ISO_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_GERMAN_MAC_ISO_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_GERMAN_MAC_ISO_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_GERMAN_MAC_ISO_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_GERMAN_MAC_ISO_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define DE_CIRC KC_GRV // ^ (dead)
|
||||
#define DE_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_GREEK_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_GREEK_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_GREEK_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_GREEK_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_GREEK_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define GR_GRV KC_GRV // `
|
||||
#define GR_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_HEBREW_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_HEBREW_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_HEBREW_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_HEBREW_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_HEBREW_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define IL_SCLN KC_GRV // ;
|
||||
#define IL_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_HUNGARIAN_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_HUNGARIAN_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_HUNGARIAN_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_HUNGARIAN_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_HUNGARIAN_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define HU_0 KC_GRV // 0
|
||||
#define HU_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_ICELANDIC_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_ICELANDIC_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_ICELANDIC_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_ICELANDIC_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_ICELANDIC_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define IS_RNGA KC_GRV // ° (dead)
|
||||
#define IS_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_IRISH_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_IRISH_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_IRISH_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_IRISH_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_IRISH_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define IE_GRV KC_GRV // `
|
||||
#define IE_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_ITALIAN_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_ITALIAN_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_ITALIAN_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_ITALIAN_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_ITALIAN_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define IT_BSLS KC_GRV // (backslash)
|
||||
#define IT_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_ITALIAN_MAC_ANSI_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_ITALIAN_MAC_ANSI_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_ITALIAN_MAC_ANSI_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_ITALIAN_MAC_ANSI_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_ITALIAN_MAC_ANSI_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define IT_LABK KC_GRV // <
|
||||
#define IT_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_ITALIAN_MAC_ISO_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_ITALIAN_MAC_ISO_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_ITALIAN_MAC_ISO_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_ITALIAN_MAC_ISO_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_ITALIAN_MAC_ISO_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define IT_BSLS KC_GRV // (backslash)
|
||||
#define IT_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_JAPANESE_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_JAPANESE_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_JAPANESE_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_JAPANESE_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_JAPANESE_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define JP_ZKHK KC_GRV // Zenkaku ↔ Hankaku ↔ Kanji (半角 ↔ 全角 ↔ 漢字)
|
||||
#define JP_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_KOREAN_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_KOREAN_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_KOREAN_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_KOREAN_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_KOREAN_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define KR_GRV KC_GRV // `
|
||||
#define KR_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_LATVIAN_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_LATVIAN_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_LATVIAN_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_LATVIAN_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_LATVIAN_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define LV_GRV KC_GRV // `
|
||||
#define LV_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_LITHUANIAN_AZERTY_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_LITHUANIAN_AZERTY_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_LITHUANIAN_AZERTY_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_LITHUANIAN_AZERTY_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_LITHUANIAN_AZERTY_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define LT_GRV KC_GRV // `
|
||||
#define LT_EXLM KC_1 // !
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_LITHUANIAN_QWERTY_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_LITHUANIAN_QWERTY_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_LITHUANIAN_QWERTY_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_LITHUANIAN_QWERTY_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_LITHUANIAN_QWERTY_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define LT_GRV KC_GRV // `
|
||||
#define LT_AOGO KC_1 // Ą
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_NEO2_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_NEO2_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_NEO2_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_NEO2_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_NEO2_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define NE_CIRC KC_GRV // ^ (dead)
|
||||
#define NE_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_NORDIC_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_NORDIC_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_NORDIC_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_NORDIC_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_NORDIC_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define NO_HALF KC_GRV
|
||||
#define NO_PLUS KC_MINS
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_NORMAN_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_NORMAN_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_NORMAN_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_NORMAN_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_NORMAN_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define NM_GRV KC_GRV // `
|
||||
#define NM_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_NORWEGIAN_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_NORWEGIAN_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_NORWEGIAN_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_NORWEGIAN_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_NORWEGIAN_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define NO_PIPE KC_GRV // |
|
||||
#define NO_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_PLOVER_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_PLOVER_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_PLOVER_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_PLOVER_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_PLOVER_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define PV_NUM KC_1
|
||||
#define PV_LS KC_Q
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_PLOVER_DVORAK_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_PLOVER_DVORAK_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_PLOVER_DVORAK_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_PLOVER_DVORAK_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_PLOVER_DVORAK_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define PD_NUM DV_1
|
||||
#define PD_LS DV_Q
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_POLISH_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_POLISH_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_POLISH_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_POLISH_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_POLISH_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define PL_GRV KC_GRV // `
|
||||
#define PL_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_PORTUGUESE_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_PORTUGUESE_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_PORTUGUESE_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_PORTUGUESE_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_PORTUGUESE_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define PT_BSLS KC_GRV // (backslash)
|
||||
#define PT_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_PORTUGUESE_MAC_ISO_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_PORTUGUESE_MAC_ISO_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_PORTUGUESE_MAC_ISO_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_PORTUGUESE_MAC_ISO_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_PORTUGUESE_MAC_ISO_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define PT_SECT KC_GRV // §
|
||||
#define PT_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_ROMANIAN_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_ROMANIAN_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_ROMANIAN_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_ROMANIAN_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_ROMANIAN_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define RO_DLQU KC_GRV // „
|
||||
#define RO_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_RUSSIAN_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_RUSSIAN_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_RUSSIAN_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_RUSSIAN_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_RUSSIAN_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define RU_YO KC_GRV // Ё
|
||||
#define RU_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_RUSSIAN_TYPEWRITER_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_RUSSIAN_TYPEWRITER_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_RUSSIAN_TYPEWRITER_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_RUSSIAN_TYPEWRITER_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_RUSSIAN_TYPEWRITER_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define RU_PIPE KC_GRV // |
|
||||
#define RU_NUM KC_1 // №
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_SERBIAN_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_SERBIAN_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_SERBIAN_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_SERBIAN_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_SERBIAN_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define RS_GRV KC_GRV // `
|
||||
#define RS_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_SERBIAN_LATIN_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_SERBIAN_LATIN_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_SERBIAN_LATIN_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_SERBIAN_LATIN_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_SERBIAN_LATIN_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define RS_SLQU KC_GRV // ‚ (dead)
|
||||
#define RS_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_SLOVAK_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_SLOVAK_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_SLOVAK_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_SLOVAK_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_SLOVAK_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define SK_SCLN KC_GRV // ;
|
||||
#define SK_PLUS KC_1 // +
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_SLOVENIAN_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_SLOVENIAN_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_SLOVENIAN_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_SLOVENIAN_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_SLOVENIAN_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define SI_CEDL KC_GRV // ¸ (dead)
|
||||
#define SI_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_SPANISH_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_SPANISH_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_SPANISH_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_SPANISH_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_SPANISH_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define ES_MORD KC_GRV // º
|
||||
#define ES_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_SPANISH_DVORAK_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_SPANISH_DVORAK_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_SPANISH_DVORAK_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_SPANISH_DVORAK_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_SPANISH_DVORAK_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define DV_MORD KC_GRV // º
|
||||
#define DV_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_SPANISH_LATIN_AMERICA_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_SPANISH_LATIN_AMERICA_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_SPANISH_LATIN_AMERICA_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_SPANISH_LATIN_AMERICA_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_SPANISH_LATIN_AMERICA_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define ES_PIPE KC_GRV // |
|
||||
#define ES_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_SWEDISH_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_SWEDISH_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_SWEDISH_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_SWEDISH_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_SWEDISH_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define SE_SECT KC_GRV // §
|
||||
#define SE_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_SWEDISH_MAC_ANSI_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_SWEDISH_MAC_ANSI_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_SWEDISH_MAC_ANSI_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_SWEDISH_MAC_ANSI_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_SWEDISH_MAC_ANSI_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define SE_LABK KC_GRV // <
|
||||
#define SE_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_SWEDISH_MAC_ISO_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_SWEDISH_MAC_ISO_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_SWEDISH_MAC_ISO_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_SWEDISH_MAC_ISO_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_SWEDISH_MAC_ISO_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define SE_SECT KC_GRV // §
|
||||
#define SE_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_SWEDISH_PRO_MAC_ANSI_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_SWEDISH_PRO_MAC_ANSI_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_SWEDISH_PRO_MAC_ANSI_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_SWEDISH_PRO_MAC_ANSI_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_SWEDISH_PRO_MAC_ANSI_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define SE_LABK KC_GRV // <
|
||||
#define SE_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_SWEDISH_PRO_MAC_ISO_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_SWEDISH_PRO_MAC_ISO_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_SWEDISH_PRO_MAC_ISO_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_SWEDISH_PRO_MAC_ISO_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_SWEDISH_PRO_MAC_ISO_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define SE_SECT KC_GRV // §
|
||||
#define SE_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_SWISS_DE_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_SWISS_DE_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_SWISS_DE_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_SWISS_DE_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_SWISS_DE_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
#undef CH_H
|
||||
|
||||
// Aliases
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_SWISS_FR_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_SWISS_FR_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_SWISS_FR_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_SWISS_FR_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_SWISS_FR_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
#undef CH_H
|
||||
|
||||
// Aliases
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_TURKISH_F_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_TURKISH_F_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_TURKISH_F_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_TURKISH_F_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_TURKISH_F_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define TR_PLUS KC_GRV // +
|
||||
#define TR_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_TURKISH_Q_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_TURKISH_Q_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_TURKISH_Q_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_TURKISH_Q_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_TURKISH_Q_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define TR_DQUO KC_GRV // "
|
||||
#define TR_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_UK_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_UK_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_UK_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_UK_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_UK_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define UK_GRV KC_GRV // `
|
||||
#define UK_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_UKRAINIAN_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_UKRAINIAN_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_UKRAINIAN_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_UKRAINIAN_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_UKRAINIAN_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define UA_QUOT KC_GRV // '
|
||||
#define UA_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_US_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_US_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_US_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_US_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_US_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define KC_TILD S(KC_GRAVE) // ~
|
||||
#define KC_EXLM S(KC_1) // !
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_US_EXTENDED_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_US_EXTENDED_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_US_EXTENDED_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_US_EXTENDED_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_US_EXTENDED_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define US_GRV KC_GRV // `
|
||||
#define US_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_US_INTERNATIONAL_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_US_INTERNATIONAL_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_US_INTERNATIONAL_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_US_INTERNATIONAL_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_US_INTERNATIONAL_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define US_DGRV KC_GRV // ` (dead)
|
||||
#define US_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_US_INTERNATIONAL_LINUX_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_US_INTERNATIONAL_LINUX_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_US_INTERNATIONAL_LINUX_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_US_INTERNATIONAL_LINUX_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_US_INTERNATIONAL_LINUX_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define US_DGRV KC_GRV // ` (dead)
|
||||
#define US_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_WORKMAN_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_WORKMAN_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_WORKMAN_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_WORKMAN_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_WORKMAN_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define WK_GRV KC_GRV // `
|
||||
#define WK_1 KC_1 // 1
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "keycodes.h"
|
||||
// clang-format off
|
||||
|
||||
#define QMK_WORKMAN_ZXCVM_KEYCODES_VERSION "0.0.1"
|
||||
#define QMK_WORKMAN_ZXCVM_KEYCODES_VERSION_BCD 0x00000001
|
||||
#define QMK_WORKMAN_ZXCVM_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_WORKMAN_ZXCVM_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_WORKMAN_ZXCVM_KEYCODES_VERSION_PATCH 1
|
||||
|
||||
// Aliases
|
||||
#define WK_GRV KC_GRV // `
|
||||
#define WK_1 KC_1 // 1
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# include INTROSPECTION_KEYMAP_C
|
||||
#endif // INTROSPECTION_KEYMAP_C
|
||||
|
||||
#include "compiler_support.h"
|
||||
#include "keymap_introspection.h"
|
||||
#include "util.h"
|
||||
|
||||
@@ -30,9 +31,9 @@ __attribute__((weak)) uint8_t keymap_layer_count(void) {
|
||||
}
|
||||
|
||||
#ifdef DYNAMIC_KEYMAP_ENABLE
|
||||
_Static_assert(NUM_KEYMAP_LAYERS_RAW <= MAX_LAYER, "Number of keymap layers exceeds maximum set by DYNAMIC_KEYMAP_LAYER_COUNT");
|
||||
STATIC_ASSERT(NUM_KEYMAP_LAYERS_RAW <= MAX_LAYER, "Number of keymap layers exceeds maximum set by DYNAMIC_KEYMAP_LAYER_COUNT");
|
||||
#else
|
||||
_Static_assert(NUM_KEYMAP_LAYERS_RAW <= MAX_LAYER, "Number of keymap layers exceeds maximum set by LAYER_STATE_(8|16|32)BIT");
|
||||
STATIC_ASSERT(NUM_KEYMAP_LAYERS_RAW <= MAX_LAYER, "Number of keymap layers exceeds maximum set by LAYER_STATE_(8|16|32)BIT");
|
||||
#endif
|
||||
|
||||
uint16_t keycode_at_keymap_location_raw(uint8_t layer_num, uint8_t row, uint8_t column) {
|
||||
@@ -61,7 +62,7 @@ __attribute__((weak)) uint8_t encodermap_layer_count(void) {
|
||||
return encodermap_layer_count_raw();
|
||||
}
|
||||
|
||||
_Static_assert(NUM_KEYMAP_LAYERS_RAW == NUM_ENCODERMAP_LAYERS_RAW, "Number of encoder_map layers doesn't match the number of keymap layers");
|
||||
STATIC_ASSERT(NUM_KEYMAP_LAYERS_RAW == NUM_ENCODERMAP_LAYERS_RAW, "Number of encoder_map layers doesn't match the number of keymap layers");
|
||||
|
||||
uint16_t keycode_at_encodermap_location_raw(uint8_t layer_num, uint8_t encoder_idx, bool clockwise) {
|
||||
if (layer_num < NUM_ENCODERMAP_LAYERS_RAW && encoder_idx < NUM_ENCODERS) {
|
||||
@@ -106,7 +107,7 @@ __attribute__((weak)) uint16_t combo_count(void) {
|
||||
return combo_count_raw();
|
||||
}
|
||||
|
||||
_Static_assert(ARRAY_SIZE(key_combos) <= (QK_KB), "Number of combos is abnormally high. Are you using SAFE_RANGE in an enum for combos?");
|
||||
STATIC_ASSERT(ARRAY_SIZE(key_combos) <= (QK_KB), "Number of combos is abnormally high. Are you using SAFE_RANGE in an enum for combos?");
|
||||
|
||||
combo_t* combo_get_raw(uint16_t combo_idx) {
|
||||
if (combo_idx >= combo_count_raw()) {
|
||||
@@ -133,7 +134,7 @@ __attribute__((weak)) uint16_t tap_dance_count(void) {
|
||||
return tap_dance_count_raw();
|
||||
}
|
||||
|
||||
_Static_assert(ARRAY_SIZE(tap_dance_actions) <= (QK_TAP_DANCE_MAX - QK_TAP_DANCE), "Number of tap dance actions exceeds maximum. Are you using SAFE_RANGE in tap dance enum?");
|
||||
STATIC_ASSERT(ARRAY_SIZE(tap_dance_actions) <= (QK_TAP_DANCE_MAX - QK_TAP_DANCE), "Number of tap dance actions exceeds maximum. Are you using SAFE_RANGE in tap dance enum?");
|
||||
|
||||
tap_dance_action_t* tap_dance_get_raw(uint16_t tap_dance_idx) {
|
||||
if (tap_dance_idx >= tap_dance_count_raw()) {
|
||||
@@ -161,7 +162,7 @@ __attribute__((weak)) uint16_t key_override_count(void) {
|
||||
return key_override_count_raw();
|
||||
}
|
||||
|
||||
_Static_assert(ARRAY_SIZE(key_overrides) <= (QK_KB), "Number of key overrides is abnormally high. Are you using SAFE_RANGE in an enum for key overrides?");
|
||||
STATIC_ASSERT(ARRAY_SIZE(key_overrides) <= (QK_KB), "Number of key overrides is abnormally high. Are you using SAFE_RANGE in an enum for key overrides?");
|
||||
|
||||
const key_override_t* key_override_get_raw(uint16_t key_override_idx) {
|
||||
if (key_override_idx >= key_override_count_raw()) {
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
#include "led_matrix.h"
|
||||
#include "progmem.h"
|
||||
#include "eeprom.h"
|
||||
#include "eeconfig.h"
|
||||
#include "keyboard.h"
|
||||
#include "sync_timer.h"
|
||||
@@ -46,6 +45,9 @@ const led_point_t k_led_matrix_center = LED_MATRIX_CENTER;
|
||||
#define LED_MATRIX_CUSTOM_EFFECT_IMPLS
|
||||
|
||||
#include "led_matrix_effects.inc"
|
||||
#ifdef COMMUNITY_MODULES_ENABLE
|
||||
# include "led_matrix_community_modules.inc"
|
||||
#endif
|
||||
#ifdef LED_MATRIX_CUSTOM_KB
|
||||
# include "led_matrix_kb.inc"
|
||||
#endif
|
||||
@@ -86,9 +88,9 @@ static last_hit_t last_hit_buffer;
|
||||
const uint8_t k_led_matrix_split[2] = LED_MATRIX_SPLIT;
|
||||
#endif
|
||||
|
||||
EECONFIG_DEBOUNCE_HELPER(led_matrix, EECONFIG_LED_MATRIX, led_matrix_eeconfig);
|
||||
EECONFIG_DEBOUNCE_HELPER(led_matrix, led_matrix_eeconfig);
|
||||
|
||||
void eeconfig_update_led_matrix(void) {
|
||||
void eeconfig_force_flush_led_matrix(void) {
|
||||
eeconfig_flush_led_matrix(true);
|
||||
}
|
||||
|
||||
@@ -283,6 +285,15 @@ static void led_task_render(uint8_t effect) {
|
||||
#include "led_matrix_effects.inc"
|
||||
#undef LED_MATRIX_EFFECT
|
||||
|
||||
#ifdef COMMUNITY_MODULES_ENABLE
|
||||
# define LED_MATRIX_EFFECT(name, ...) \
|
||||
case LED_MATRIX_COMMUNITY_MODULE_##name: \
|
||||
rendering = name(&led_effect_params); \
|
||||
break;
|
||||
# include "led_matrix_community_modules.inc"
|
||||
# undef LED_MATRIX_EFFECT
|
||||
#endif
|
||||
|
||||
#if defined(LED_MATRIX_CUSTOM_KB) || defined(LED_MATRIX_CUSTOM_USER)
|
||||
# define LED_MATRIX_EFFECT(name, ...) \
|
||||
case LED_MATRIX_CUSTOM_##name: \
|
||||
@@ -359,7 +370,12 @@ void led_matrix_task(void) {
|
||||
}
|
||||
}
|
||||
|
||||
__attribute__((weak)) bool led_matrix_indicators_modules(void) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_matrix_indicators(void) {
|
||||
led_matrix_indicators_modules();
|
||||
led_matrix_indicators_kb();
|
||||
}
|
||||
|
||||
@@ -371,6 +387,10 @@ __attribute__((weak)) bool led_matrix_indicators_user(void) {
|
||||
return true;
|
||||
}
|
||||
|
||||
__attribute__((weak)) bool led_matrix_indicators_advanced_modules(uint8_t led_min, uint8_t led_max) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_matrix_indicators_advanced(effect_params_t *params) {
|
||||
/* special handling is needed for "params->iter", since it's already been incremented.
|
||||
* Could move the invocations to led_task_render, but then it's missing a few checks
|
||||
@@ -378,6 +398,7 @@ void led_matrix_indicators_advanced(effect_params_t *params) {
|
||||
* led_task_render, right before the iter++ line.
|
||||
*/
|
||||
LED_MATRIX_USE_LIMITS_ITER(min, max, params->iter - 1);
|
||||
led_matrix_indicators_advanced_modules(min, max);
|
||||
led_matrix_indicators_advanced_kb(min, max);
|
||||
}
|
||||
|
||||
|
||||
@@ -98,6 +98,12 @@ enum led_matrix_effects {
|
||||
#include "led_matrix_effects.inc"
|
||||
#undef LED_MATRIX_EFFECT
|
||||
|
||||
#ifdef COMMUNITY_MODULES_ENABLE
|
||||
# define LED_MATRIX_EFFECT(name, ...) LED_MATRIX_COMMUNITY_MODULE_##name,
|
||||
# include "led_matrix_community_modules.inc"
|
||||
# undef LED_MATRIX_EFFECT
|
||||
#endif
|
||||
|
||||
#if defined(LED_MATRIX_CUSTOM_KB) || defined(LED_MATRIX_CUSTOM_USER)
|
||||
# define LED_MATRIX_EFFECT(name, ...) LED_MATRIX_CUSTOM_##name,
|
||||
# ifdef LED_MATRIX_CUSTOM_KB
|
||||
@@ -115,7 +121,7 @@ enum led_matrix_effects {
|
||||
};
|
||||
|
||||
void eeconfig_update_led_matrix_default(void);
|
||||
void eeconfig_update_led_matrix(void);
|
||||
void eeconfig_force_flush_led_matrix(void);
|
||||
void eeconfig_debug_led_matrix(void);
|
||||
|
||||
uint8_t led_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user